Array Only
feeeeeeet
这个作者很懒,什么都没留下…
展开
-
Leetcode 26. Remove Duplicates from Sorted Array
class Solution { public int removeDuplicates(int[] nums) { int pre=1; int cur=1; if(nums.length<=1){ return nums.length; } int curNu...原创 2018-11-16 06:42:51 · 69 阅读 · 0 评论 -
Leetcode 56. Merge Intervals
# Definition for an interval. # class Interval: # def __init__(self, s=0, e=0): # self.start = s # self.end = e class Solution: def merge(self, intervals): """ ...原创 2018-12-13 03:22:22 · 71 阅读 · 0 评论 -
Leetcode 57. Insert Interval
# Definition for an interval. # class Interval: # def __init__(self, s=0, e=0): # self.start = s # self.end = e class Solution: def insert(self, intervals, newInterval): ...原创 2018-12-13 04:59:57 · 79 阅读 · 0 评论 -
Leetcode 66. Plus One
99.83% class Solution: def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ res=[] tmp=0 for i in digits[::-1原创 2018-12-27 01:02:19 · 68 阅读 · 0 评论 -
Leetcode 67. Add Binary
class Solution: def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str """ m=len(a)-1 n=len(b)-1 res=''原创 2018-12-27 06:07:00 · 65 阅读 · 0 评论 -
Leetcode81. Search in Rotated Sorted Array II
class Solution: def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: bool """ left=0 right=len(nums)-1原创 2018-12-30 23:30:25 · 83 阅读 · 0 评论 -
Leetcode 85. Maximal Rectangle
same method to leetcode 84 reference: https://blog.csdn.net/doc_sgl/article/details/11832965 https://www.cnblogs.com/lupx/archive/2015/10/20/leetcode-85.html class Solution(object): def maximalRec...原创 2018-12-31 06:52:27 · 137 阅读 · 0 评论 -
Leetcode 88. Merge Sorted Array
class Solution: def merge(self, nums1, m, nums2, n): """ :type nums1: List[int] :type m: int :type nums2: List[int] :type n: int :rtype: void Do no...原创 2018-12-31 07:49:46 · 86 阅读 · 0 评论