© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Suresh Krishnan
A learner
You did a mistake in the first for loop where you get the input it should be
cin>>arr[i]
and in the second for loop initialize the i as s-1 it will work
Harsh Kumar
learning to code
thank you so much