Group Array Elements By Value Javascript Interview