Add Space O(n) method by reusing a vector, the same approach and time complexity as the 2-d Dynamic Programming method on the second place