easy
feeeeeeet
这个作者很懒,什么都没留下…
展开
-
Leetcode 27. Remove Element
class Solution { public int removeElement(int[] nums, int val) { int left=0; int right=nums.length-1; if(right<0){ return nums.length; } whil...原创 2018-11-16 07:09:00 · 81 阅读 · 0 评论 -
Leetcode 35. Search Insert Position
class Solution: def searchInsert(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ start=0 end=len(nums)-1 ...原创 2018-12-04 11:35:47 · 65 阅读 · 0 评论 -
Leetcode 61. Rotate List
Calculate the length of the list and use k%length. # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution...原创 2018-12-26 00:29:28 · 82 阅读 · 0 评论 -
Leetcode 64. Minimum Path Sum
class Solution: def minPathSum(self, grid): """ :type grid: List[List[int]] :rtype: int """ m=len(grid) n=len(grid[0]) for i in range(m): ...原创 2018-12-26 01:36:48 · 67 阅读 · 0 评论