• + 0 comments

    try this out.it worked for me.and it is in java


    static void beautifulDays(int i, int j, int k) { int cnt=0; for(int p=i;p<=j;p++) {int tmp=p,r=0; while(tmp>0) {r=r10+tmp%10; tmp/=10;} if(((p-r)%k)==0) {cnt+=1;} } System.out.println(cnt); }