You are viewing a single comment's thread. Return to all comments →
Here is my solution in JavaScript:
` let count = 0
for(let n = i; n <= j; n++){
const reversed = parseInt(n.toString().split('').reverse().join(''), 10);
const diff = Math.abs(n - reversed);
if(diff % k === 0){ count++ }
}
return count; `
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Days at the Movies
You are viewing a single comment's thread. Return to all comments →
Here is my solution in JavaScript:
` let count = 0
for(let n = i; n <= j; n++){
const reversed = parseInt(n.toString().split('').reverse().join(''), 10);
const diff = Math.abs(n - reversed);
}
return count; `