摘要:
第二遍Better做法: 第11行 i>start && nums[i]==nums[i-1] 就skip很不错 第一遍做法:需要已访问数组,当前后元素一样且前面元素并未访问,这个时候就是重复的case, continue, 注意这里的判重复条件跟3Sum那种是不一样的, 3SUM防止重复方法是 i 阅读全文
摘要:
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
摘要:
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文