04 2021 档案

摘要:# # # @param num int整型一维数组 # @param target int整型 # @return int整型 # class Solution: def threeSumClosest(self , num , target ): # write code here num.so 阅读全文
posted @ 2021-04-23 14:05 YBINing 阅读(68) 评论(0) 推荐(0)
摘要:# # # @param A int整型一维数组 # @param target int整型 # @return int整型一维数组 # class Solution: def searchRange(self , A , target ): resList = [] List = [] for i 阅读全文
posted @ 2021-04-21 14:30 YBINing 阅读(40) 评论(0) 推荐(0)
摘要:# class Interval: # def __init__(self, a=0, b=0): # self.start = a # self.end = b # # # @param intervals Interval类一维数组 # @return Interval类一维数组 # class 阅读全文
posted @ 2021-04-19 16:29 YBINing 阅读(42) 评论(0) 推荐(0)
摘要:恢复内容开始 null 恢复内容结束 阅读全文
posted @ 2021-04-18 18:24 YBINing 阅读(42) 评论(0) 推荐(0)
摘要:# # # @param m int整型 # @param n int整型 # @return int整型 # class Solution: def uniquePaths(self , m , n ): dp = [[1 for i in range(n)] for j in range(m)] 阅读全文
posted @ 2021-04-17 13:13 YBINing 阅读(180) 评论(0) 推荐(0)
摘要:# # # @param x int整型 # @return int整型 # class Solution: def sqrt(self , x ): if x <= 0: return 0 r = 1 while True: b = r r = (r + x/r) / 2 if (abs(r-b) 阅读全文
posted @ 2021-04-16 13:14 YBINing 阅读(34) 评论(0) 推荐(0)
摘要:# # # @param numbers int整型一维数组 # @param target int整型 # @return int整型一维数组 # class Solution: def twoSum(self , numbers , target ): res = [0,0]#保存结果 mp = 阅读全文
posted @ 2021-04-15 15:44 YBINing 阅读(36) 评论(0) 推荐(0)
摘要:# # # @param x int整型 # @return int整型 # class Solution: def reverse(self , x ): flag = False if x == 0 or x == -0 : return x if x < 0: x = -x flag = Tr 阅读全文
posted @ 2021-04-12 17:07 YBINing 阅读(57) 评论(0) 推荐(0)
摘要:# # # @param matrix int整型二维数组 # @return void # class Solution: def rotate(self , matrix ): count = len(matrix) if count == 1: return matrix for i in r 阅读全文
posted @ 2021-04-11 13:21 YBINing 阅读(45) 评论(0) 推荐(0)
摘要:# class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param root TreeNode类 # @return int整型 # class S 阅读全文
posted @ 2021-04-09 18:47 YBINing 阅读(36) 评论(0) 推荐(0)
摘要:# # # @param matrix int整型二维数组 # @return int整型一维数组 # class Solution: def spiralOrder(self , matrix ): res = [] while matrix: res += matrix[0] matrix = 阅读全文
posted @ 2021-04-09 18:46 YBINing 阅读(29) 评论(0) 推荐(0)
摘要:# # # @param height int整型一维数组 # @return int整型 # class Solution: def maxArea(self , height ): tempaer = 0 maxtempaer = 0 i = 0 j = len(height) - 1 if l 阅读全文
posted @ 2021-04-09 18:45 YBINing 阅读(61) 评论(0) 推荐(0)
摘要:# # # @param n int整型 # @return int整型二维数组 # class Solution: def generateMatrix(self , n ): if n<= 0: return[] res = [[0 for i in range(n)] for j in ran 阅读全文
posted @ 2021-04-05 13:45 YBINing 阅读(44) 评论(0) 推荐(0)
摘要:@param prices int整型一维数组 @return int整型 class Solution: def maxProfit(self , prices ): # write code here result = 0 for i in range(1, len(prices)): tmp 阅读全文
posted @ 2021-04-04 18:47 YBINing 阅读(40) 评论(0) 推荐(0)
摘要:1 # 2 # 3 # @param A int整型一维数组 4 # @return int整型 5 # 6 class Solution: 7 def maxSubArray(self , A ): 8 max_sim = A[0] 9 sim = A[0] 10 if not A : 11 re 阅读全文
posted @ 2021-04-03 20:27 YBINing 阅读(55) 评论(0) 推荐(0)
摘要:# class ListNode: # self.val = x # self.next = None # # # @param l1 ListNode类 # @param l2 ListNode类 # @return ListNode类 # class Solution: def mergeTwo 阅读全文
posted @ 2021-04-02 12:14 YBINing 阅读(46) 评论(0) 推荐(0)
摘要:# class ListNode: # def __init__(self, x): # self.val = x # self.next = None # # # @param head ListNode类 # @return ListNode类 # class Solution: def del 阅读全文
posted @ 2021-04-01 13:03 YBINing 阅读(34) 评论(0) 推荐(0)