Studying EPI, 2015 Java ed (ver 1.5.7). In Section 18.5 (3-sum problem) an example input array (2,3,5,7,11)
is said to have no three entries adding up to 9. Repeat use of the same elements is allowed. If so, (3,3,3)
does add up to 9. What am I missing?
EPI (Java) 3-sum problem example *can* add up to 9?
dukehoops
#1
0 Likes
Hey,
Many thanks for your report, and it actually is a bug here. I have changed the wording from 9 to 22 instead.
Please keep up updated about anything you feel we should improve, and I really appreciate for your comment and suggestion.
0 Likes
Hey @jgriin,
Sorry I don’t get it about your point of (7, 7, 7) here? Could you explain it more?
0 Likes
jgriin
#5
Sure.
I’ve got the version 1.5.5 (of the c++ version not the java one).
On the 3-sum problem: it says that with the array [2, 3, 5, 7, 11], the only two arrays which add up to 21 are [3, 7, 11] and [5, 5, 11]. Since we can use the same entry more than once, [7, 7, 7] is a valid answer for 21 too.
0 Likes