Tutorial of 3buj

Prerequisite : Bruteforce
Problem statement summary : You are given 3 integers A, B, C representing the length of three straight lines. You have to tell if you can make a triangle with these lines.
Solution : We can make a triangle if and only if following condition satisfied:

  1. A + B > C
  2. A + C > B
  3. B + C > A

Because we know that, sum of any two sides strictly greater than other side.

Time Complexity : O(1)

0 comments

No comments so far...

Information

ID
1047
Difficulty
3
Category
Beginners দেখানোর জন্য ক্লিক করুন
Tags
(None)
# Submissions
86
Accepted
45
Accepted Ratio
52%
Uploaded By