Stock span problem

this code is not passing the second test case,pls point out what is missing in this code


added comments where update made

thanks !

1 Like