Digits in ascending order. Given a three-digit integer, print YES if its digits go in ascending order, print NO otherwise.
Input |
Correct answer |
123 |
YES |
132 |
NO |
231 |
NO |
213 |
NO |
312 |
NO |
Python, Java
Digits in ascending order. Given a three-digit integer, print YES if its digits go in ascending order, print NO otherwise.
Input |
Correct answer |
123 |
YES |
132 |
NO |
231 |
NO |
213 |
NO |
312 |
NO |