Skip to content

shoppinglist

bradendubois edited this page Nov 11, 2021 · 10 revisions

Shopping List

ID: shoppinglist

Difficulty: 3.2

CPU Time: 1 second

Memory: 1024 MB

Solution

For this, if we treat each line as a set of items, then what everyone buys is in the intersection of all the sets. This can be easy depending on the language used; just output the length of this intersection, sort it and print each item.

Clone this wiki locally