add two new solutions
add a O(n) space solution