Jiro
ABC 371Problem 45 of 50
EasyWhat to do
Three brothers A, B, C have their ages compared in 3 pairs: A vs B, A vs C, B vs C. Each comparison is '<' (first is younger) or '>' (first is older). Determine which brother is the second oldest and return 'A', 'B', or 'C'.
Key Concepts
if-statements
comparison operators
conditional logic
Examples
Input:
relations = '< < <'
Output:
B
Input:
relations = '< < >'
Output:
C
Tips for Beginners
- Focus on understanding the logic, not memorizing syntax
- Use print statements to debug your code
- Don't worry about input parsing - the function handles that for you
- If stuck, try writing out your solution on paper first
Python Editor
Loading Python...