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