For each arr[i], find distance to next strictly larger element to the right. If none, 0. EXAMPLE: [1, 0, 3, 2] - [2, 1, 0, 0] REQUIREMENT: O(n). MONOTONIC DECREASING STACK (right-to-left): EQUIVALENT LEFT-TO-RIGHT VERSION: COMPLEXITY: O(n) — each index pushed/
12 questions
All 12 Agoda questionsHints, answers & walkthroughs