Opening your workspace…
Workspace/Coding room
Opening your workspace…
Help Rose make room for Jack on the floating door. Each '.' is a usable square of wood and each '#' is a hole. A person lying flat needs three consecutive usable squares in one row or column. Rose can slide over or turn before Jack climbs on. Return how many of the two can fit at once without sharing a square.
["...#","###.","###.","###."]Output2Rose can lie across the top row. Jack can lie down the rightmost column in the three rows below her.
["#.#","...","#.#"]Output1Rose can lie along either arm of the cross, but both placements use the center square.
Enumerate the straight three-square placements. Check whether another placement avoids all three squares.
function solve(door) { // 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.