摘要:
思路:折半查找,关键在于停止循环的条件。 1 class Solution(object): 2 def searchInsert(self, nums, target): 3 """ 4 :type nums: List[int] 5 :type target: int 6 :rtype: int 阅读全文
posted @ 2020-04-17 22:49
人间烟火地三鲜
阅读(201)
评论(0)
推荐(0)
摘要:
思路见注释。 1 class Solution(object): 2 def removeElement(self, nums, val): 3 """ 4 :type nums: List[int] 5 :type val: int 6 :rtype: int 7 """ 8 if len(num 阅读全文
posted @ 2020-04-17 22:47
人间烟火地三鲜
阅读(135)
评论(0)
推荐(0)
摘要:
1 class Solution(object): 2 def removeDuplicates(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: int 6 """ 7 i = 0 8 while i < len(nums)-1: 9 if 阅读全文
posted @ 2020-04-17 22:43
人间烟火地三鲜
阅读(127)
评论(0)
推荐(0)

浙公网安备 33010602011771号