?LeetCode刷題實(shí)戰(zhàn)119: 楊輝三角 II
Given an integer rowIndex, return the rowIndexth row of the Pascal's triangle.
Notice that the row index starts from 0.
題意

示例:
輸入: 3
輸出: [1,3,3,1]
解題
class?Solution?{
????public?ListgetRow(int?rowIndex) {
????????Integer[] result = new?Integer[rowIndex+1];
????????Arrays.fill(result, 0);
????????result[0] = 1;
????????for(int?i = 1; i????????????for(int?j=i;j>0;j--) {
????????????????result[j] = result[j] + result[j-1];
????????????}
????????}
????????return?Arrays.asList(result);
????}
}
LeetCode刷題實(shí)戰(zhàn)113:路徑總和 II
LeetCode刷題實(shí)戰(zhàn)114:二叉樹展開為鏈表
LeetCode刷題實(shí)戰(zhàn)115:不同的子序列
LeetCode刷題實(shí)戰(zhàn)116:填充每個(gè)節(jié)點(diǎn)的下一個(gè)右側(cè)節(jié)點(diǎn)指針
LeetCode刷題實(shí)戰(zhàn)117:填充每個(gè)節(jié)點(diǎn)的下一個(gè)右側(cè)節(jié)點(diǎn)指針 II
LeetCode刷題實(shí)戰(zhàn)118:楊輝三角
