heights[i] is the height of building i (0-based). The wind blows from the start of the street, so a building is sheltered when the building **right before it** is taller than limit (strictly). Building 0 has nothing in front of it and is never sheltered.
Return the indices of all sheltered buildings in any order.heights=[4, 9, 2, 7, 6], limit=5 → [2, 4]
Only buildings 1 (height 9) and 3 (height 7) are taller than 5, so the buildings right after them, 2 and 4, are sheltered.
heights=[3, 3, 3], limit=3 → []
A height strictly above 3 is needed, and no building has one.
heights=[50, 1], limit=10 → [1]
heights=[4, 9, 2, 7, 6], limit=5
[2, 4]
Run checks the first 3 tests in your browser. Submit checks all 112 tests on the server, hidden ones included.