Stock span 1 test case failing

Inside the for loop change the second condition to include the = case also. That should work.

still 1 test case is wrong

You should work the input in a reversed manner and try to find the next bigger element for each element.