LeetCode – Pascal’s Triangle II (Java)

Given an index k, return the kth row of the Pascal’s triangle. For example, when k = 3, the row is [1,3,3,1]. Analysis This problem is related to Pascal’s Triangle which gets all rows of Pascal’s triangle. In this problem, only one row is required to return. Java Solution public List<Integer> getRow(int rowIndex) { ArrayList<Integer> … Read more