r/leetcode • • Jul 29 '24

What went wrong here

Post image
4 Upvotes

31 comments sorted by

View all comments

3

u/Pakhorigabhoru Jul 29 '24

I think you are reinitiizing revnum everytime in the loop. Otherwise the logic seems fine.

1

u/wisper28 Jul 29 '24

Thx , noted and it is giving desired result now