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: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int