Team Formation

  • + 1 comment

    the question was pretty hard but can be solved by maintaining a hashmap of the max element and a multiset of the max lengths for that element.