CodeCracker123's blog

By CodeCracker123, history, 8 years ago, In English

I know this might be crazy but i tried to attempt a E question with a simple solution which might hit a TLE, but got a wrong answer in test case 4.Can anybody help me point out where i have gone wrong? I tried figuring out where i had gone wrong, but couldnt find out. Thank you.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
Rev. 2   Vote: I like it +6 Vote: I do not like it

Change

if(n>42)
return ispower(n / 42);

to

if(n>42 && n % 42 == 0)
      return ispower(n/42);

and it will get tle.