Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 351 Bytes

File metadata and controls

5 lines (3 loc) · 351 Bytes

Asked by Pinterest

Question

The sequence [0, 1, ..., N] has been jumbled, and the only clue you have for its order is an array representing whether each number is larger or smaller than the last. Given this information, reconstruct an array that is consistent with it. For example, given [None, +, +, -, +], you could return [1, 2, 3, 0, 4].