Triangle Judgement
sides has columns x, y and z, the three lengths of a possible triangle. Return a list with one string per row: "Yes" if the three lengths can form a triangle (each side is shorter than the sum of the other two), otherwise "No".
Example 1
sides {"x":[3,1],"y":[4,2],"z":[5,3]}
returns ["Yes","No"]
3,4,5 works; 1,2,3 is flat, so it fails.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Weekday CountsEasy
- Weighted GradeEasy
- Words per RowEasy
- Above Department AverageMedium
- Above the Middle EverywhereMedium
- Average Experience per ProjectMedium
- Back the Next DayMedium
- Crosstab CountsMedium