摘要:
/** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), random(NULL) {} * }; */class Solution {public: RandomListNode *copyRandomList(RandomListNode *head) { ... 阅读全文
摘要:
class Solution {public: int uniquePathsWithObstacles(vector > &obstacleGrid) { vector >& dp = obstacleGrid; if (dp.empty() || dp[0].e... 阅读全文
摘要:
class Solution {public: int uniquePaths(int m, int n) { int (*dp)[101] = new int[101][101]; for (int i=0;i<101;i++) dp[0][i] = 0; ... 阅读全文