Skip to content

kafkaesque

bradendubois edited this page Nov 11, 2021 · 7 revisions

Kafkaesque

ID: kafkaesque

Difficulty: 2.0

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, simply keep a total of "passes" (starting at 0), a previous and current (initialize the previous as some kind of sentinel value like -1), and read each value one by one; if the current is less than the previous, this is an instance of an out-of-order pair of signatures requiring an additional pass. If this occurs, increment the total.

Clone this wiki locally