随笔分类 - leetcode
摘要:You are given a m x n 2D grid initialized with these three possible values. Fill each empty room with the distance to its nearest gate. If it is impos
阅读全文
摘要:解法一: 递归 解法二: DFS 解法三: BFS 解法四: 并查集
阅读全文
摘要:解法一: 两重循环, 找到这两个加和为target的数 解法二: 先将数组中所有的数存放到hashmap中, 再遍历该数组, 判断target-当前的数字nums[i]是否已在hashmap中, 若存在, 并且索引值不同, 则返回, 否则, 继续循环
阅读全文