add a O(n) space dp solution to Triangle