else Partial logic is incorrect.
if is executed only when the current value is maximum, and vice versa,
else is always executed when the current value is not maximum. That could be the case even when the current value is the minimum value, but it could be the case even if it's not.
You'll have to change where
else is now and burn a separate conditional branch.
This phrase must exist before entering the for statement.
© 2022 pinfo. All rights reserved.