1 correct test case rest all are wrong

You have missed to write the recurrence relation.
the Else case, wont be returning 1 when n > m.