[LeetCode] Find the Longest Valid Obstacle Course at Each Position

1 · · March 23, 2022, 2:44 p.m.
1964. Find the Longest Valid Obstacle Course at Each Position You want to build some obstacle courses. You are given a 0-indexed integer array obstacles of length n, where obstacles[i] describes the height of the ith obstacle. For every index i between 0 and n - 1 (inclusive), find the length of the longest obstacle course in obstacles such that: You choose any number of obstacles between 0 and i inclusive. You must include the ith obstacle in the course. You must put the chosen obstacles in t...