Use a monotonic stack to find indices of buildings with an unobstructed ocean view.
Constraints
Example
>>> ocean_view([4,2,3,1]) [0,2,3] >>> ocean_view([1,3,2,4]) [3] >>> ocean_view([]) []
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints