• + 1 comment

    int reverse(int n){ int rev=0; int rem=0; while (n!=0){ rem=n%10; rev=rev*10+rem; n/=10; } cout<< rev<< endl; return rev; } // Complete the beautifulDays function below. int beautifulDays(int i, int j, int k) { int ctr=0; for (int x =i;x<=j;x++){

        int rev=reverse(x);
        if (abs(rev-x)%k==0){
            ctr+=1;
        }
    }
    return ctr;