o同学
o同学
全部文章
分类
归档
标签
去牛客网
登录
/
注册
o同学的博客
全部文章
(共6篇)
题解 | #小红的最小三角形周长#
class Solution: def hongstriangle(self , nums: List[int]) -> int: # write code here n = len(nums) nums=sorted(nums) ...
2023-09-09
0
388
题解 | #顺时针旋转矩阵#
class Solution: def rotateMatrix(self , mat: List[List[int]], n: int) -> List[List[int]]: for i in range(n): for j ...
2023-09-09
0
270
题解 | #数组中的最长连续子序列#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # max increasing subsequence # @param arr int整型一维数组 the array # @return int整型 # class Solution: def MLS...
2023-09-01
0
380
题解 | #括号生成#
class Solution: def generateParenthesis(self , n: int) -> List[str]: # write code here rs = [] def go(l,r,temp): ...
2023-08-26
0
317
题解 | #岛屿数量#并查集
from re import L from operator import le # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 判断岛屿数量 # @param grid char字符型二维数组 # @return int整型 # class Soluti...
2023-04-21
0
272
题解 | 没有重复项数字的全排列-条件判断+回溯
主要在于nexts的选择,nexts是指拿走当前元素i后剩下的元素即为,0-i, i+1-最后,因此下次递归nexts = nexts[:i] + nexts[i+1:] class Solution: def permute(self , num: List[int]) -> Lis...
2023-04-21
0
243