Group the People Given the Group Size They Belong To at Google

Medium87.5% acceptance

This problem has 12.5% frequency at Google.

Problem Description

There are `n` people that are split into some unknown number of groups. Each person is labeled with a **unique ID**  from `0` to `n - 1`. You are given an integer array `groupSizes`, where `groupSizes[i]` is the size of the group that person `i` is in. For example, if `groupSizes[1] = 3`, then pers...

Read full problem and hints

Topics

Also asked at 4 companies


More Google Questions

View all Google questions