time difference in two same solution

i submitted my solution for the problem Please like me in jan2014 long challenge. my first solution got time limit exceeded than i created one more solution and in that solution i just added function that is called for every test cases and that is accepted!! can you tell me guys why there is so much time difference in both solution?

In your first solution you have used if(m=0), it should be if(m==0). I think that is the problem. Try changing the condition as if(m==0).

1 Like