2025年11月19日

摘要: 链接:35. 搜索插入位置 - 力扣(LeetCode) 二分+各种边缘条件的判断 1 class Solution(object): 2 def searchInsert(self, nums, target): 3 """ 4 :type nums: List[int] 5 :type targ 阅读全文
posted @ 2025-11-19 22:15 Annetree 阅读(3) 评论(0) 推荐(0)
 
摘要: 链接:200. 岛屿数量 - 力扣(LeetCode) 用深搜把每一个碰到的1都变成0,这样就处理完了一个发现的岛屿 1 class Solution(object): 2 def numIslands(self, grid): 3 """ 4 :type grid: List[List[str]] 阅读全文
posted @ 2025-11-19 15:00 Annetree 阅读(4) 评论(0) 推荐(0)