Your challenge is to write a program, function, etc. that calculates if the passed string is "in order". That means that the characters of the string have character codes that are in order from smallest to largest. The smallest char code must be the first. By that I mean lowest unicode codepoints to highest. It doesn't matter what code page you language uses.
You must return one value if the input is "in order" and another if it is not. The values must be distinct, but there is no other restriction on the output values. For example, you may print/return/output true
for !1AQaq¡±
(in order) and false
for aq!QA
. The two distinct values don't need to be truthy or falsy or anything like that, just two distinct values. Repeated strings (eg. aa
) are in order.
You only need to support up to unicode U+007E
(~
) (ascii 126)
However, the characters of your program must itself be in order. Good luck and happy code-golfing!
"aa"
in order? \$\endgroup\$ – tsh Apr 14 '17 at 3:05