101
0/304
Loading content...
A sports analytics platform tracks passing events from a single football match and needs each team's best uninterrupted sequence of internal ball movement.
Table: Teams
Table: Passes
Streak model (per team):
Task: Return one row per team with its longest_streak.
Output requirements:
Supported submission environments:
Teams:
| player_id | team_name |
|-----------|-----------|
| 1 | Arsenal |
| 2 | Arsenal |
| 3 | Arsenal |
| 4 | Arsenal |
| 5 | Chelsea |
| 6 | Chelsea |
| 7 | Chelsea |
| 8 | Chelsea |
Passes:
| pass_from | time_stamp | pass_to |
|-----------|------------|---------|
| 1 | 00:05 | 2 |
| 2 | 00:07 | 3 |
| 3 | 00:08 | 4 |
| 4 | 00:10 | 5 |
| 6 | 00:15 | 7 |
| 7 | 00:17 | 8 |
| 8 | 00:20 | 6 |
| 6 | 00:22 | 5 |
| 1 | 00:25 | 2 |
| 2 | 00:27 | 3 |[
{"team_name":"Arsenal","longest_streak":3},
{"team_name":"Chelsea","longest_streak":4}
]Arsenal's first internal run has 3 passes before interception. Chelsea records a 4-pass uninterrupted internal sequence.
Teams:
| player_id | team_name |
|-----------|-----------|
| 10 | Falcons |
| 11 | Falcons |
| 20 | Rockets |
| 21 | Rockets |
| 30 | Wolves |
| 31 | Wolves |
Passes:
| pass_from | time_stamp | pass_to |
|-----------|------------|---------|
| 10 | 01:00 | 20 |
| 11 | 01:05 | 21 |
| 20 | 01:10 | 21 |
| 21 | 01:15 | 30 |[
{"team_name":"Falcons","longest_streak":0},
{"team_name":"Rockets","longest_streak":1},
{"team_name":"Wolves","longest_streak":0}
]Falcons only make intercepted passes, Rockets have one successful internal pass, and Wolves have no outgoing pass rows.
Teams:
| player_id | team_name |
|-----------|-----------|
| 100 | North |
| 101 | North |
| 102 | North |
| 200 | South |
| 201 | South |
| 202 | South |
Passes:
| pass_from | time_stamp | pass_to |
|-----------|------------|---------|
| 100 | 12:30 | 101 |
| 101 | 12:30 | 200 |
| 102 | 12:31 | 100 |
| 200 | 12:40 | 201 |
| 201 | 12:41 | 202 |
| 202 | 12:42 | 101 |
| 200 | 12:43 | 201 |[
{"team_name":"North","longest_streak":1},
{"team_name":"South","longest_streak":2}
]North's success at 12:30 is immediately reset by another North-origin pass at the same time that is intercepted. South reaches a best run of 2 before reset.
Constraints