Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAFun 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.