-
Notifications
You must be signed in to change notification settings - Fork 2
kafkaesque
bradendubois edited this page Nov 11, 2021
·
7 revisions
ID: kafkaesque
Difficulty: 2.0
CPU Time: 1 second
Memory: 1024 MB
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.