1762. Buildings With an Ocean View
ArrayStackMonotonic Stack
Hints
Hint 1
You can traverse the buildings from the nearest to the ocean to the furthest.
Hint 2
Keep with you the maximum to the right while traversing to determine if you can see the ocean or not.
Preparing judge…