+ 5
can you have a look at my Code ?
Just a small bug i have tried to find out but unable to find out :) arr = 2 ,3 ,0 ,0 ,1 ,4 This is what i want > output = 3 ,4 ,1 ,1 ,4 ,-1 This is what I'm getting > output = 0 ,4 ,1 ,1 ,4 ,-1 here is my attempt đ https://code.sololearn.com/c64NquYQajfw/?ref=app
2 Answers
+ 3
Take condition i >= 0 instead i > 0 .
Missing to check last value at index 0.
Good use of stack.. Good logic..đ
+ 1
thank you sir đ