Since two of the balls have the number 4, I'm going to call them 41 and 42.
This means, that there are these four balls: 2, 41, 42, and 5.
Possibilities:
2 + 41 = 6 41 + 2 = 6 42 + 2 = 6 5 + 2 = 7
2 + 42 = 6 41 + 42 = 8 42 + 41 = 8 5 + 41 = 9
2 + 5 = 7 41 + 5 = 9 42 + 5 = 9 5 + 42 = 9
There are 4 ways to get a total of 6.
There are 2 ways to get a total of 7.
There are 2 ways to get a total of 8.
There are 4 ways to get a total of 9.
Can you finish the problem?