3 sum algorithm - Trying
There is no reason to use HashMap, you are not using the bools anywhere. So I think You could just use HashSet. Which you don't need to feed in foreach, instead simply pass the integers as constructor parameter.

var set = new HashSet(A);


You don't have to compare both i and j

i &lt; A.length &amp;&amp; j &lt; A.length


if j is always one larger then i, just compare with j.

This condition is always true:

(a + b + delta) == sum


since that is the way it was obtained in the first place:

Integer delta = sum - (a + b);


This:

int[] result = {a, b, delta};
return result;


could be just

return {a, b, delta};


You are returning null where you claim to return int[], not sure if that's correct.

Anyway I think your implementation does not work as intended, because it only looks for sums of two consecutive and third anywhere. It fails for example on [5,1,2,1,8] looking for 15=5+2+8.