本文共 587 字,大约阅读时间需要 1 分钟。
119.杨辉三角2
class Solution { public: vector getRow(int rowIndex) { vector res(rowIndex + 1) ; res[0] = 1 ; for ( int i = 1 ; i < rowIndex + 1 ; i ++ ) { for ( int j = i ; j > 0 ; j -- ) { res[j] = res[j] + res[j - 1] ; } } return res ; }};
class Solution { public: int maxCount(int m, int n, vector>& ops) { int len=ops.size(); if(ops.empty())return m*n; int a=ops[0][0],b=ops[0][1]; for(auto i=1;i
转载地址:http://fbmki.baihongyu.com/