組合Pascal三角Python C++解Leetcode 62 unique paths。把網站的例題轉個45度角,它的計算方式就是Pascal三角,也就是組合數C^N_K (N=n+m-2, K=m-1),程式要寫得好,還是要多學點數學!
[C++解答LeeCode 118 Pascal三角又100趴]https://youtu.be/paoJGMYEEhA?si=hrocm8UGm7xC0PZT
[codes on Leetcode]https://leetcode.com/problems/unique-paths/solutions/3994527/c-python-math-pascal-triangle-dp-beats-100/
----------
Combinatorics Pascal Triangle Python C++ Solution Leetcode 62 Unique Path. Rotate the example question image on the website 45 degrees. Its calculation method is Pascal's triangle, that is, the number of combinations C^n_k. If you want to write programs well, you need to learn more mathematics!
With a recursive formula, you can use dynamic programming, a programming technique.
沒有留言:
張貼留言