Good Soccer Team Photo
Given two lists of floating point values representing player heights for two soccer teams, determine if the photo is 'good' by checking if the players can be arranged such that all players from one team are shorter than all players from the other team. In Part 2, both teams may have different numbers of players, where any extra players are automatically considered valid.
Asked at:
Anduril
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid July, 2026
Anduril
Mid-level
You're a photographer who's taken a photo of two soccer teams. A good photo is found when both teams are lined up in the same row (all of one team is shorter or taller than the other team). Given a list per team of floating point values that represent the player's heights, determine if you photo is good or not. Note: It wasn't very clear to me in the description or explanation of the question. But after going through some examples, I realize that you can rearrange the values in the list (even you literally can't rearrange players in the photo the question doesn't make sense). Part 1: Assume that both teams have the same amount of players. Part 2: The assumption is no longer valid. Extra players will always be considered valid when figuring out a good photo.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.