How is it possible? While first element is smaller than the other. | Sololearn: Learn to code for FREE!

0

How is it possible? While first element is smaller than the other.

https://code.sololearn.com/cBjG8oWpgcRb/?ref=app

c++

7/24/2021 11:46:44 AM

TeaserCode

3 Answers

New Answer

+2

Just an idea. Try to read the string backwards. If next char value was less than current char value, subtract If next char value was greater than current char value, add

+2

Ok now it works fine Good job! 👍

+1

I go backwad and it is supposed true. You should go backward because the second element is bigger than first.