Leaderboard
Showing:
Handle Score
@Ibrahim Nash 6420
@blackshadows 6380
@mb1973 5704
@Quandray 5245
@akhayrutdinov 5111
@saiujwal13083 5046
@sanjay05 3762
@kirtidee18 3673
@marius_valentin_dragoi 3523
@mantu_singh 3510
@sushant_a 3459
Complete Leaderboard
Right angled triangles
Easy Accuracy: 47.27% Submissions: 34 Points: 2

Given three integers a, b and c. The task is to check if it is possible to make right angled triangle with sides of length a, b and c.

 

Example 1:

Input:
a = 3, b = 4, c = 5
Output:
Yes
Explanation:
We can form a right angled triangle
with sides of length 3, 4 and 5.

Example 2:

Input:
a = 2, b = 5, c = 8
Output:
No
Explanation:
We can't form a right angled triangle
with sides of length 2, 5 and 8.

 

Your Task:
You don't need to read input or print anything. Your task is to complete the function rightAngTri() which takes 3 Integers a,b and c as input and returns "Yes" if it is possible to form a right angled triangle with sides of length a, b, and c, else return "No".

 

Expected Time Complexity: O(log(max(a,b,c)))
Expected Auxiliary Space: O(1)

 

Constraints:
1 <= a,b,c <= 108

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Right angled triangles

Output Window