Array Group By Javascript Interview