0
Next greater element
This is the problem I have solved for days called Next greater element. I know the logic but cannot get the code correct. https://code.sololearn.com/ctCBgSBeMX6S/?ref=app
2 Antworten
+ 1
What is your code supposed to do? What's the logic behind it?
0
if the next element greater than the current element, you print out the next one. if the next is < the current, the next becomes -1.