Buildings With an Ocean View (LC #1762) is tagged for Meta. Buildings have an ocean view if no taller building is to their right. Scan from right to left, tracking the maximum height seen. If current building is taller than the max, it has a view. Add its index to the result and update the max. Reverse the result at the end for ascending order. This runs in time and extra space excluding output. Meta tests your ability to choose the right traversal direction based on the problem constraints.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/arrays-strings/buildings-with-an-ocean-view
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████████████████████████████████████████████████████████████████████████████████████████