摘要: 答案: class Solution: def sortColors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ p0, cur, p2 = 0, 0, l 阅读全文
posted @ 2021-10-18 22:03 Geeksongs 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 这道题我看了解答感觉不是很对,因为并没有实现原地对数组进行修改。但还是记录一下,这种解题方法还是很值得学习的。 题目如下: 解答的方法如下: class Solution: def removeElement(self, nums: List[int], val: int) -> int: #原地移 阅读全文
posted @ 2021-10-18 20:59 Geeksongs 阅读(26) 评论(0) 推荐(0) 编辑

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.