This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!
Submit FeedbackFun challenge!
I think there needs to be a count distinct of leagues, not just a count. In any case, solution attached.
First one done, could've done much better but it's working.
The posted output should include New York City as a city without teams in each league. There are 5 teams in NYC, but they are 2 hockey, 2 basketball and 1 baseball. There aren't any football or soccer teams. Also, one could argue that the Bronx should actually be classified as NYC, but that still wouldn't give NYC a team from each league. There would be 2 hockey, 2 basketball, 2 baseball and one soccer.
Regardless, here is my solution.
Not the prettiest solution, but it got the job done.