牛客262968463号
牛客262968463号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客262968463号的博客
全部文章
(共38篇)
题解 | #螺旋矩阵#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param matrix int整型二维数组 # @return int整型一维数组 # class Solution: def spiralOrder(self , matrix: List...
2023-07-04
0
335
题解 | #买卖股票的最好时机(一)#
#处理入参 length=int(input()) nums=list(map(int,input().split())) def func(length,nums): #最大利润等于当前数值减去最小买入值 #dp数组代表每个位置的最大利润,min_price代表遍历过程中的最小值 ...
2023-06-07
0
297
题解 | #【模板】前缀和#
#对数据进行处理 n,q=map(int,list(input().split())) lis=list(map(int,input().split())) #创建一个dp数组,用于存放每个位置下从索引0到当前索引下的和 dp=[0]*n for i in range(n): if i==0...
2023-06-05
0
246
题解 | #不相邻取数#
#先获取输入数据 l=int(input()) #数组长度转换成int类型 nums=list(map(int,input().split())) #一列数字转换成列表 if l<=2: print(max(nums)) #若数组长度小于等于2,直接返回最大值 else: #创建d...
2023-06-04
1
370
题解 | #跳跃游戏(一)#
#此题利用动态规划思路 a=int(input()) #取出数组长度 b=[int(i) for i in input().split()] #取出数组内容 if len(b)==1: #如果数组只有1的长度,那必然已经在终点 print("true") else: #创建dp数组,0代...
2023-06-02
2
356
题解 | #将查询后的列重新命名#
select device_id as user_info_example from user_profile where id limit 0,2 #通过as改表名
2023-03-02
0
202
题解 | #链表中环的入口结点#
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def EntryN...
2023-02-27
0
287
题解 | #判断链表中是否有环#
# class ListNode: # def __init__(self, x): # self.val = x # self.next = None # # # @param head ListNode类 # @return(756076230) b...
2023-02-27
0
269
题解 | #合并两个排序的链表#
class Solution: def Merge(self , pHead1: ListNode, pHead2: ListNode) : def create_list(head,lis): #这是一个遍历链表生成列表的函数 while head...
2023-02-27
0
180
题解 | #字符串的排列#
#这题可以通过递归完成,但要注意去重的问题 class Solution: def Permutation(self , str: str) : # write code here def back(path,used): #path用来记录当前的字符串 ...
2023-02-27
0
195
首页
上一页
1
2
3
4
下一页
末页