This problem combines hashing with a clever key-design pattern — choosing the right hash key is a skill that transfers to many grouping problems.
Enable JavaScript for the full StreamPrep guide.