towAsOne challenge

Hi,

I am working on below challenge
http://codingbat.com/prob/p113261

I tried my code as below
``````public boolean twoAsOne(int a, int b, int c) {
if((a+b)==c)
{
return true;
}

else if((b+c)==a)
{
return true;
}

else if((a+c)==b)
{
return true;
}
else
return false;
}
``````

I am getting below result
Expected      Run
twoAsOne(1, 2, 3) → true      true      OK
twoAsOne(3, 1, 2) → true      true      OK
twoAsOne(3, 2, 2) → false      false      OK
twoAsOne(2, 3, 1) → true      true      OK
twoAsOne(5, 3, -2) → true      true      OK
twoAsOne(5, 3, -3) → false      false      OK
twoAsOne(2, 5, 3) → true      true      OK
twoAsOne(9, 5, 5) → false      false      OK
twoAsOne(9, 4, 5) → true      true      OK
twoAsOne(5, 4, 9) → true      true      OK
twoAsOne(3, 3, 0) → true      true      OK
twoAsOne(3, 3, 2) → false      false      OK
other tests
OK

how to  improve my approach and design of this challenge. How do i make a

graphical venn or some other relevant diagram to design it before writing single

line of code to decide best strategy?
LVL 7
Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
It's a bit wordy, but fine. You could have just done

``````return a+b == c || a+c == b || c+b == a;
``````

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
:)
Commented:
// overkill in this case, but
List<Integer> list = new ArrayList<Integer>();