Skip to content

Practice Triangle Judgement

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#610
LeetCode Problem

Triangle Judgement

Problem Statement

Tables: Triangle(x INT, y INT, z INT). Triangle has key (x, y, z); the three values are segment lengths. Return x, y, z and triangle for every row, using Yes if the lengths form a nondegenerate triangle and No otherwise. Each pair of lengths must sum to more than the third. Output order is unrestricted.

Source: Triangle Judgement on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
Triangle table: +----+----+----+ | x  | y  | z  | +----+----+----+ | 13 | 15 | 30 | | 10 | 20 | 15 | +----+----+----+
Output
+----+----+----+----------+ | x  | y  | z  | triangle | +----+----+----+----------+ | 13 | 15 | 30 | No       | | 10 | 20 | 15 | Yes      | +----+----+----+----------+

Related LeetCode Problems

Practice more problems similar to Triangle Judgement.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.