摘要:
恢复内容开始 null 恢复内容结束 阅读全文
摘要:
# # # @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)] 阅读全文
摘要:
# # # @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) 阅读全文
摘要:
# # # @param numbers int整型一维数组 # @param target int整型 # @return int整型一维数组 # class Solution: def twoSum(self , numbers , target ): res = [0,0]#保存结果 mp = 阅读全文
摘要:
# # # @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 阅读全文
摘要:
# # # @param matrix int整型二维数组 # @return void # class Solution: def rotate(self , matrix ): count = len(matrix) if count == 1: return matrix for i in r 阅读全文
摘要:
# class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param root TreeNode类 # @return int整型 # class S 阅读全文
摘要:
# # # @param matrix int整型二维数组 # @return int整型一维数组 # class Solution: def spiralOrder(self , matrix ): res = [] while matrix: res += matrix[0] matrix = 阅读全文
摘要:
# # # @param height int整型一维数组 # @return int整型 # class Solution: def maxArea(self , height ): tempaer = 0 maxtempaer = 0 i = 0 j = len(height) - 1 if l 阅读全文
摘要:
# # # @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 阅读全文