Skip to content
bradendubois edited this page Nov 24, 2021 · 12 revisions

Line Them Up

ID: lineup

Difficulty: 1.9

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, one can read in all the names, but put them on two lists, one of which is for the original order, and one that can be adjusted. Sort the second list, and then check if the two lists have a matching ordering; if so, "INCREASING". If not, reverse the second list and check again; a match means "DECREASING". Otherwise, "NEITHER".

Clone this wiki locally