Given an integer rowIndex, return row number rowIndex (0-indexed) of Pascal's triangle. In Pascal's triangle every number is the sum of the two numbers directly above it, and each row starts and ends with 1.
Follow up: can you use only O(rowIndex) extra space?