Grid Unique Paths Time : Space : 12345678910int Solution::uniquePaths(int A, int B) { vector<int> dp(B); dp[0] = 1; for(int i = 0; i < A; i++) { for(int j = 0; j < B; j++) { dp[j] = (j ? dp[j-1] : 0) + dp[j]; } } return dp[B-1];}