Puneet
BAN USER
Comments (8)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
I have change the code slightly to remove the condition on return statements....
- Puneet September 22, 2012public static int triangleType(int a, int b, int c) {
if (a <= 0 || b <= 0 || c <= 0) {
return 4;
}
long ab = a + b;
long bc = b + c;
long ca = c + a;
if (ab <= c || bc <= a || ca <= b) {
return 4;
}
int count = 1;
if (a == b)
count++;
if (b == c)
count++;
return count;
}
If any error please comment....