leetcode题
leetcode做题
xipxiks
这个作者很懒,什么都没留下…
展开
-
leetcode-简单-389. 找不同
用异或 ^两个相同的值异或运算后值为0ex: a^a = 0 a^a^a^a =0 a^0=a b^a^a=b^(a^a)=b^0=b d=0 for i in s + t: d^= ord(i) return chr(d)...原创 2018-07-15 12:11:21 · 2164 阅读 · 0 评论 -
leetcode-简单-283. 移动零
自己的: i = 0 j = 0 while i < len(nums) - 1: if nums[i] == 0: nums.pop(i) j += 1 continue else: ...原创 2018-07-14 23:14:18 · 196 阅读 · 0 评论 -
leetcode-简单题-35. 搜索插入位置 Python
class Solution: def searchInsert(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ # target 最大时 if targ...原创 2018-07-14 22:11:38 · 378 阅读 · 0 评论