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
2
Category
Beginners Click to Show
Tags
(None)
# Submissions
90
Accepted
53
Accepted Ratio
59%
Uploaded By