Opening your workspace…
Workspace/Coding room
Opening your workspace…
Help Walt toss pizzas onto the garage roof at 308 Negra Arroyo Lane. He gets one throw per pizza. For each pizza, he knows the stretch of roof it will cover when it lands. He can skip any pizza, but he wants every pizza he throws to land flat. What is the largest number he can land without any two overlapping?
[[0,9],[5,8],[0,2],[2,5]]Output3Skip the pizza that covers [0,9]. The pizzas covering [0,2], [2,5], and [5,8] fit edge to edge.
[[2,7],[0,4],[5,9]]Output2Walt can land [0,4] and [5,9]. The pizza covering [2,7] would overlap both.
Choose the available landing that ends farthest to the left.
function solve(landings) { // Write your solution 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.