AlgoMaster Logo

Buildings With an Ocean View

heights=[4, 2, 3, 1]
0 / 14
algomaster.io
Step:Brute force: a building has a view if every building to its right is shorter.