上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 恢复内容开始 null 恢复内容结束 阅读全文
posted @ 2021-04-18 18:24 YBINing 阅读(36) 评论(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 阅读(175) 评论(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 阅读(29) 评论(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 阅读(33) 评论(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 阅读(48) 评论(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 阅读(37) 评论(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 阅读(30) 评论(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 阅读(27) 评论(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 阅读(47) 评论(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 阅读(41) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页