勇敢牛牛生活灿烂
勇敢牛牛生活灿烂
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
勇敢牛牛生活灿烂的博客
全部文章
(共7篇)
题解 | #最长不含重复字符的子字符串#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param s string字符串 # @return int整型 # class Solution: def lengthOfLongestSubstring(self , s: str) ...
Python3
动态规划
2022-05-23
0
384
题解 | #矩形覆盖#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param number int整型 # @return int整型 # class Solution: def rectCover(self , number: int) -> int...
Python3
动态规划
递归
2022-05-22
0
301
题解 | #礼物的最大价值#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param grid int整型二维数组 # @return int整型 # class Solution: def maxValue(self , grid: List[List[int]]...
Python3
动态规划
2022-05-19
0
350
题解 | #跳台阶扩展问题#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param number int整型 # @return int整型 # class Solution: def jumpFloorII(self , number: int) -> i...
Python3
动态规划
2022-05-17
0
347
题解 | #跳台阶#
# 动态规划 class Solution: def jumpFloor(self , number: int) -> int: # write code here dp = [0 for _ in range(number+1)] # dp[i] 表示...
Python3
动态规划
2022-05-17
0
320
题解 | #连续子数组的最大和#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param array int整型一维数组 # @return int整型 # class Solution: def FindGreatestSumOfSubArray(self , arr...
Python3
动态规划
2022-05-08
0
339
题解 | #最长上升子序列(一)#
class Solution: def LIS(self , arr: List[int]) -> int: # write code here # dp[i]表示包含底i个元素的最大上升子序列的长度 if not arr: ...
Python3
动态规划
一位数组
2022-05-05
2
358