It’s exactly the same approach as grouping personnel by Office. You can get a department for each employee Which results in being a crucial inside the map, as well as the corresponding values will be the lists of workforce assigned to that Office. In cases like this, the keys tend to be the sorted terms, as well as values would be the dictionary