Opening your workspace…
Workspace/Coding room
Opening your workspace…
Two brewery branches list their spare crates by roast-day number in nondecreasing order. A tasting exchange pairs one crate from each branch only when their roast-day numbers match. Each crate can be used once. Return the roast-day numbers of as many pairs as possible, in nondecreasing order. Repeated numbers represent different crates, so include a number once for every pair it can make. Do not rearrange or modify either input list.
[2,2,5,9], [2,5,5,9]OUTPUT[2,5,9]One crate of day 2, one of day 5, and one of day 9 can be paired. The extra day-2 crate has no partner.
[4,4,4], [4,4]OUTPUT[4,4]Two distinct day-4 pairs use both crates from the second branch.
Tab inserts two spaces. Press Escape, then Tab, to leave the editor. Press Control or Command and Enter to submit.
[2,2,5,9], [2,5,5,9][2,5,9]Public samples only. These checks do not award ranked points.
Walk through a solution, check its time and space costs, and compare it with yours.
Checking your progress…