Sort by

recency

|

1743 Discussions

|

  • + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/6rYwcW6BYH4

    int beautifulDays(int i, int j, int k) {
        int ans = 0;
        for(int el = i; el <= j; el++){
            string s = to_string(el);
            reverse(s.begin(), s.end());
            if(abs(stoi(s) -el ) % k == 0) ans++;
        }
        return ans;
    }
    
  • + 0 comments

    Lily’s unique game of finding beautiful days adds a touch of fun to decision-making. A beautiful day is when the absolute difference between a day and its reversed form is perfectly divisible by a given number. Imagine calculating this for a range of days to decide which are worth a movie outing! It’s an intriguing way to explore patterns in numbers while adding meaning to leisure activities. Speaking of movies, why not make the most of your beautiful days with MagisTV App? It’s your ultimate app for endless entertainment and a perfect movie companion.

  • + 0 comments

    Beautiful days at the movies are a treasure for film lovers, offering a perfect escape into captivating stories and cinematic magic. Whether it’s the latest Bollywood blockbuster or a heartfelt indie film, the experience is always enriching. For fans of Indian entertainment, platforms like apnetv.com hindi serials provide an excellent way to keep up with the latest dramas, films, and shows. It’s a hub for staying connected with all things Bollywood and beyond, ensuring the magic of storytelling is always within reach, even from the comfort of your home.

  • + 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;
    }
    
  • + 0 comments

    TypeScript:

    function reverse(num: number): number {
        const reversedNumString = num.toString().split("").reverse().join("");
        return parseInt(reversedNumString, 10);
    }
    
    function beautifulDays(i: number, j: number, k: number): number {
    
        return Array.from({length: Math.abs(j - i + 1)}, (_, x) => i + x * 1)
                    .filter((num: number) => Math.abs(num - reverse(num))%k == 0).length;
    
    }