LeetCode
Pascal’s Triangle II
Click
here
for an explanation.