Project 3 of 20, for Caitlin
Lost Property Matcher
Match what was left behind after the Studio's game nights against what people have asked about, counting every umbrella once.
Sign up free to open itLog in
Act 2 needs a free account, so your work is saved as you go. Act 1 is open to everyone.
The brief
- CaitlinI've ended up in charge of the Studio's lost property box, and Friday game nights keep it full.
- CaitlinEvery umbrella's written down twice, some of them three times, and there's one scarf that's on there eleven times.
- CaitlinI just want each thing listed once, and I'd like to know which ones people have asked about.
- PaulSounds like a job for sets, because they don't hold with duplicates either.
found lists everything handed in, repeats and all. reported lists what people have asked about.
Write report(found, reported). It prints four lines:
- how many different items were handed in
- the items handed in that someone has asked about
- the items handed in that nobody has asked about
- the items asked about that haven't turned up
Items go in alphabetical order, separated by , . A line with no items says none.
Handed in: 4 different items Matched: black umbrella, red scarf Nobody has asked about: blue headphones, dice bag Still missing: spare controller
What you learn
What's in it
- One of each
- How many different things
- Comparing two sets
- In both boxes
- How fast is in
- The raffle tickets
- How Paul would do it
- Fix Aaesha's version
- Make the lost property matcher
- Ship it