bGZo's Notes

  • Description
  • Solutions
  • Solution
Home

❯

archives

❯

clip leetcode

❯

unique paths

unique-paths

Jan 15, 20251 min read

Description

via: https://leetcode.cn/problems/unique-paths

Solutions

Solution

    class Solution {
      public:
      int dp[101]\[101];
      int uniquePaths(int m, int n) {
        for(int i = 1; i<=m; i++) dp[i]\[1] = 1;
        for(int i = 1; i<=n; i++) dp[1]\[i] = 1;
        for(int i = 2; i<=m ; i++){
          for(int j =2; j<=n ; j++){
            dp[i]\[j] = dp[i-1]\[j] + dp[i]\[j-1];
          }
        }
        return dp[m]\[n];
      }
    };
  • 空间优化没怎么看懂;
  • 【组合数学】马拦过河卒 | 潮汐朝夕

  • Description
  • Solutions
  • Solution

Graph View

Recent Notes

  • osm0sis/PlayIntegrityFork

    May 11, 2025

    • star
  • j-hc/revanced-magisk-module

    May 11, 2025

    • star
  • mentalblank/Tiktok-Revanced

    May 11, 2025

    • star

Created with Quartz v4.5.0 © 2025

  • Source
  • RSS
  • Telegram