+ 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

21st Sep 2022, 8:50 AM
Davinder Kumar
Davinder Kumar - avatar
2 Réponses
+ 3
Take condition i >= 0 instead i > 0 . Missing to check last value at index 0. Good use of stack.. Good logic..👏
21st Sep 2022, 10:16 AM
Jayakrishna 🇮🇳
+ 1
thank you sir 😇
21st Sep 2022, 2:05 PM
Davinder Kumar
Davinder Kumar - avatar