NeetCode #770LC-1762MediumGreedy
← Back to All Problems#770 · #1762 · Buildings With an Ocean View(能看到海景的建筑物)
📌 Problem Statement & Constraints
There is a row of buildings with heights
heights, and the ocean is to the right. A building has an ocean view if every building to its right is strictly shorter. Return the indices of such buildings in increasing order. Constraints: 1 <= heights.length <= 10^5, 1 <= heights[i] <= 10^9.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!