public class Solution {
public List<Integer> getRow(int rowIndex) {
int n = rowIndex;
int[] tmp = new int[2*n+3];
tmp[n+1] = 1;
int left = n+1, right = n+1;
while (n > 0) {
left;
++right;
for (int i = left; i <= right; i += 2) {
tmp[i] = tmp[i1] + tmp[i+1];
}
}
List<Integer> ret = new ArrayList<>();
for (int i = left; i <= right; i += 2) {
ret.add(tmp[i]);
}
return ret;
}
}
1ms java O(k) space beats 90%


Why does this solution only take 1ms? It seems to be more complex than the solution at https://leetcode.com/discuss/43757/anotheracceptedjavasolution