• + 0 comments

    JS/Javascript:-

    function beautifulDays(i, j, k) {
        let beautifulDaysCount = 0;
        for (let index = i;index<= j; index++) {
            const reversedIndex = Number(index.toString().split('').reverse().join(''));
            if ((index - reversedIndex)%k ===0) beautifulDaysCount++;
        }
    return beautifulDaysCount;
    }