HackerRank: Beautiful Days at the Movies (Easy)

Link to code challenge
function beautifulDays(i, j, k) { let count = 0; for (let day = i; day <= j; day++) { let reverse = parseFloat(day.toString().split("").reverse().join("")); if (Math.abs(day - reverse) % k === 0) count++; } return count; }

Comments

Popular posts from this blog

Code Wars: String incrementer

Code Wars: Replace With Alphabet Position

Code Wars: Find the odd int