118. Pascal's Triangle Posted on 2020-12-05 In 面試 Views: Symbols count in article: 201 Reading time ≈ 1 mins. In Pascal’s triangle, each number is the sum of the two numbers directly above it. Example: 123456789Input: 5Output:[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]] 想起一開始學Java用雙迴圈解(遠目),當然可以用Python做一次,但對O(nˆ2)不太滿意,就參考網友動態規劃的做法。 如果你覺得這篇文章很棒,請你不吝點讚 (゚∀゚) Welcome to my other publishing channels RSS