Loading content...
A national student leadership council is assembling a three-member delegation.
Table: school_a
Table: school_b
Table: school_c
Each delegate team must include exactly:
A team is valid only if all three selected IDs are pairwise different and all three selected names are pairwise different.
Task: Return every valid team as (member_a, member_b, member_c), where each member column is the selected student_name from the corresponding school.
Output requirements:
Supported submission environments:
school_a:
| student_id | student_name |
|------------|--------------|
| 1 | Alice |
| 2 | Bob |
school_b:
| student_id | student_name |
|------------|--------------|
| 3 | Tom |
school_c:
| student_id | student_name |
|------------|--------------|
| 3 | Tom |
| 2 | Jerry |
| 10 | Alice |[
{"member_a":"Alice","member_b":"Tom","member_c":"Jerry"},
{"member_a":"Bob","member_b":"Tom","member_c":"Alice"}
]Triplets with repeated names or repeated IDs across selected members are rejected. Only the two shown combinations satisfy both pairwise-distinct constraints.
school_a:
| student_id | student_name |
|------------|--------------|
| 11 | Zara |
school_b:
| student_id | student_name |
|------------|--------------|
| 22 | Liam |
school_c:
| student_id | student_name |
|------------|--------------|
| 33 | Noor |[
{"member_a":"Zara","member_b":"Liam","member_c":"Noor"}
]There is exactly one possible triplet and both IDs and names are mutually distinct, so it is valid.
school_a:
| student_id | student_name |
|------------|--------------|
| 5 | Iris |
| 6 | Owen |
school_b:
| student_id | student_name |
|------------|--------------|
| 5 | Miko |
| 8 | Iris |
school_c:
| student_id | student_name |
|------------|--------------|
| 6 | Dana |
| 9 | Miko |[
{"member_a":"Owen","member_b":"Iris","member_c":"Miko"}
]Most combinations fail because of either ID collisions (for example A.id=6 with C.id=6) or name collisions (for example B.name=Miko with C.name=Miko). Only one triplet satisfies all six pairwise checks.
Constraints