不难,不过写递归过程还是犯了些错误。 Pascal’s triangle 挺有名的,Binomial Coefficients好像是很重要的组合数学概念。
Java
1 | public List<List<Integer>> generate(int numRows) { |
Submission Detail
- 15 / 15 test cases passed.
- Your runtime beats 100.00 % of java submissions.
JavaScript
1 | /** |
Submission Detail
- 15 / 15 test cases passed.
- Your runtime beats 90.59 % of javascript submissions.