Opening your workspace…
Workspace/Coding room
Opening your workspace…
After practice, Santa’s reindeer need to find their assigned stalls. You’re given the reindeer in the order they leave the practice area and a list of stall assignments. Return the stall number for each reindeer, in departure order.
["Dasher","Dancer","Prancer"], [{"name":"Prancer","stall":3},{"name":"Dasher","stall":1},{"name":"Dancer","stall":2}]Output[1,2,3]Look up each reindeer’s assigned stall in the order they leave practice.
["Vixen","Comet"], [{"name":"Comet","stall":8},{"name":"Vixen","stall":5}]Output[5,8]Vixen leaves first and goes to stall 5; Comet follows to stall 8.
Index the assignments by name, then follow the departure list.
function solve(reindeer, assignments) { // 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.