Opening your workspace…
Workspace/Coding room
Opening your workspace…
Moss pays his landlord by the minute whenever the bakery awning is open. Each shower sends an appointment slip [start, end]. Moss opens at start and closes at end, keeping the awning up where showers overlap. Return the total number of minutes on his bill. Practice rank · 6 kyu (Brewery estimate).
[[6,10],[1,8],[12,14]]OUTPUT11From time 1 until time 10 the awning is up for nine minutes. The later shower adds two.
[[5,5]]OUTPUT0The sun comes out as the slip arrives.
Sort the slips. How much of the next shower falls beyond the latest closing time?
function solve(slips) { // 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.
[[6,10],[1,8],[12,14]]11