Buildings stand in a row with the ocean to the right (after the last building). A building has an ocean view if every building to its right is strictly shorter. Return the indices of all buildings with an ocean view, in increasing order. The input is JSON {heights}.
Input: JSON {heights}.
Output: Array — the indices with an ocean view.
Input: {"heights":[4,2,3,1]}
Output: [0,2,3]
Explanation: Buildings 0, 2, 3 see the ocean.Input: {"heights":[4,3,2,1]}
Output: [0,1,2,3]
Explanation: All see the ocean.Input: {"heights":[1,3,2,4]}
Output: [3]
Explanation: Only the tallest last building.1<=n<=10^5