Create two sum

Use a map to store the previous value, in each iteration, need to make sure there is a solution, then to see if need to put the value into the map.