Opening your workspace…
Workspace/Coding room
Opening your workspace…
Mr Bell rings his hat whenever the roof beneath him stands strictly higher than both neighbouring roofs. He crosses the row once from left to right. Return the zero-based positions where his hat rings. At either end he has only one neighbour and keeps his hat quiet. Practice rank · 7 kyu (Brewery estimate).
[1,4,2,5,5,1]OUTPUT[1]The roof at position 1 stands alone. The two fives share a ridge.
[]OUTPUT[]Mr Bell takes the pavement.
A flat ridge gives the hat no reason to ring.
function solve(heights) { // Write your answer here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.
[1,4,2,5,5,1][1]