Nandu
Nandu
全部文章
分类
题解(19)
归档
标签
去牛客网
登录
/
注册
Nandu的博客
全部文章
(共19篇)
题解 | #跳台阶扩展问题#
代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 @param number int整型 @return int整型 1级台阶对应1种跳法 2级台阶对应2中跳法 3级台阶对应4种跳法 4级台阶对应8中跳法 n级台阶对应2的n-1次方跳法 class Solution: ...
Python3
2021-11-18
0
279
题解 | #跳台阶#
代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 @param number int整型 @return int整型 class Solution: def jumpFloor(self , number: int) -> int: # w...
Python3
2021-11-18
0
341
题解 | #统计大写字母个数#
while True: try: s = input() count = 0 for i in s: if 'A'<= i <= 'Z': count += 1 ...
Python3
2021-10-30
9
1080
题解 | #参数解析#
'''s = input().split(' ') print(len(s)) for i in s: print(i)''' '''import re s = input() s1 = re.split(r'[\"\"]'+' ', s) print(s1) for i in s1: ...
Python3
2021-10-29
1
570
题解 | #单词倒排#
import re '''s = input() for i in s: if ('a'<= i <= 'z' or 'A' <= i <= 'Z') == False: i = ' ' # 不知道这样为啥不能替换掉非字母字符 ss = s.split...
Python3
2021-10-29
0
386
题解 | #计算日期到天数转换#
s = input().split() y, m, d = int(s[0]), int(s[1]), int(s[2]) if m < 9: lm = (m-1) // 2 # 小月个数 bm = m - 1 - lm # 大月个数 day = bm * 31 + 3...
Python3
2021-10-29
0
365
题解 | #栈的压入、弹出序列#
# -*- coding:utf-8 -*- class Solution: def IsPopOrder(self, pushV, popV): # write code here # result = True l = [] ...
Python3
2021-10-27
0
436
题解 | #包含min函数的栈#
# -*- coding:utf-8 -*- class Solution: def __init__(self): self.stack1 = [] self.stack2 = [] def push(self, node): # w...
Python3
2021-10-25
0
397
题解 | #用两个栈实现队列#
# -*- coding:utf-8 -*- class Solution: def __init__(self): self.stack1 = [] self.stack2 = [] def push(self, node): # w...
Python3
2021-10-25
0
317
题解 | #最小的K个数#
# -*- coding:utf-8 -*- class Solution: def GetLeastNumbers_Solution(self, tinput, k): # write code here n = len(tinput) if...
Python3
2021-10-20
0
333
首页
上一页
1
2
下一页
末页