You are given an integer array heights representing the heights of buildings in a row. The ocean is located to the right of all the buildings.
A building has an ocean view if every building to its right has a strictly smaller height.
Return an array containing the indices of all buildings that have an ocean view, sorted in increasing order. The indices are
Constraints:
heights.length
heights[i]
You are given an integer array heights representing the heights of buildings in a row. The ocean is located to the right of all the buildings.
A building has an ocean view if every building to its right has a strictly smaller height.
Return an array containing the indices of all buildings that have an ocean view, sorted in increasing order. The indices are
Constraints:
heights.length
heights[i]