MSTE
MSTE
python split array ```python class Solution: def splitArray(self, nums: List[int], m: int) -> int: #二分搜索算法,x为最小子串和,f(x)为最小子串和对应的分段数,target为目标分段数 #找到目标分段数target下,最小的子串和 #即为找到target目标分段数区间的左端点 left = max(nums) right = sum(nums) + 1 while left < right: mid...
785 Python3 DFS ```python3 class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: #DFS self.isBp = True self.visited = set() self.colormap = {} for i in range(len(graph)): #已遍历过的连接子图跳过 if i not...