摘要:
题目描述: 方法一:动态规划 O(mnlogmn) class Solution(object): def longestIncreasingPath(self, matrix): if not matrix or not matrix[0]: return 0 m, n = len(matrix) 阅读全文
摘要:
题目描述: 方法:二分法 O(N*log(summ - maxn)) class Solution: def splitArray(self, nums: List[int], m: int) -> int: n = len(nums) s = 0 for num in nums: s += num 阅读全文
摘要:
恢复内容开始 题目描述: 方法一:边统计边压缩: class Solution { public int numSubmat(int[][] mat) { int row = mat.length, col = mat[0].length, ans = 0; for (int i = 0; i < 阅读全文
摘要:
题目描述: 第一次提交:通过76/78 留坑 class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: dic = {} l = [] for i in range(len(graph)): if graph[i] 阅读全文
摘要:
题目描述: 方法:动态规划 class Solution: def winnerSquareGame(self, n: int) -> bool: dp = [False, True, False] for x in range(3, n+1): dp.append(False) for y in 阅读全文