swaaaay
swaaaay
全部文章
题解
未归档(36)
归档
标签
去牛客网
登录
/
注册
swaaaay的博客
全部文章
/ 题解
(共47篇)
题解 | #坐标移动#
来自专栏
def get_ans(s): if not s: return x,y,li=0,0,s.split(';') for item in li: try: direction,step=item[0],item[1:] ...
Python3
2022-02-28
0
292
题解 | #链表中环的入口结点#
来自专栏
class Solution: def EntryNodeOfLoop(self, pHead): # write code here if not pHead: return None mark=set() curr=pHea...
Python3
2022-02-28
0
287
题解 | #整数中1出现的次数(从1到n整数中1出现的次数)#
来自专栏
class Solution: def NumberOf1Between1AndN_Solution(self , n: int) -> int: mark='' for i in range(1,n+1): mark+=str(...
Python3
2022-02-28
1
278
题解 | #两个链表的第一个公共结点#
来自专栏
很浪漫的代码:大胆地往前走,我们都是对方的退路。 class Solution: def FindFirstCommonNode(self , pHead1 , pHead2 ): # write code here mark1,mark2=pHead1,pH...
Python3
2022-02-28
0
355
题解 | #提取不重复的整数#
来自专栏
def get_ans(s): s,mark,ans=s[::-1],set(),'' for i in s: if i not in mark: ans+=i mark.add(i) return ans ...
Python3
2022-02-24
0
299
题解 | #删除字符串中出现次数最少的字符#
来自专栏
def get_ans(s): dic={} for i in s: dic[i]=dic.get(i,0)+1 dic1=sorted(dic.items(),key=lambda d:d[1]) mark,ans=dic1[0][1],'' ...
Python3
2022-02-24
0
313
题解 | #扑克牌大小#
来自专栏
def get_ans(s1,s2): # 王炸 if s1=='joker JOKER' or s2=='joker JOKER': return 'joker JOKER' # 个子 对子 三个 顺子 炸弹之间 keys=[str(i) for i in range(3...
Python3
2021-12-14
1
597
题解 | #密码验证合格程序#
来自专栏
用python集合挺方便的 def get_ans(s): return 'OK' if (len(s)>8 and three_types(s) and sub_str(s)) else 'NG' def three_types(s): mark=set() for...
Python3
2021-12-14
1
582
题解 | #合并表记录#
来自专栏
def get_ans(li): ans=dict() for i in range(int(li[0])): key,val=li[i+1].split(' ') key,val=int(key),int(val) ans[key]=...
Python3
数组
2021-12-14
0
364
题解 | #链表中环的入口结点#
来自专栏
class Solution: def EntryNodeOfLoop(self, pHead): # write code here mark=set() curr=pHead while curr: ...
Python3
2021-12-06
0
408
首页
上一页
1
2
3
4
5
下一页
末页