2020年8月3日

原地删除(27)

摘要: 法一: class Solution: def removeElement(self, nums: List[int], val: int) -> int: for i in range(len(nums)-1, -1, -1): if(nums[i] == val): nums.pop(i) re 阅读全文

posted @ 2020-08-03 13:48 不要挡着我晒太阳 阅读(112) 评论(0) 推荐(0) 编辑

旋转数组(189)

摘要: 法一: class Solution: def rotate(self, nums: List[int], k: int) -> None: """ Do not return anything, modify nums in-place instead. """ n = len(nums) k % 阅读全文

posted @ 2020-08-03 10:39 不要挡着我晒太阳 阅读(110) 评论(0) 推荐(0) 编辑

导航