Questions:
Solutions:
var getNumber = function(binary) {
let num = binary.data + "";
while (binary.next !== null) {
binary = binary.next;
//add the next element’s value onto the current binary
num += binary.data;
}
let tmp = "";
num.split("").reverse().forEach((x,i) => {
number = BigInt(Math.pow(2, i) * x) + BigInt(tmp);
});
return tmp.toString();
};var sundays = 0;
for (var month = 1; month<=12; month++) {
if (new Date(year, month-1, 1).getDay() == 0) {
sundays++;
}
}
return sundays