swaaaay
swaaaay
全部文章
题解
未归档(36)
归档
标签
去牛客网
登录
/
注册
swaaaay的博客
全部文章
/ 题解
(共47篇)
题解 | #把数组排成最小的数#
来自专栏
import functools class Solution: def PrintMinNumber(self , numbers: List[int]) -> str: # write code here if not numbers: return...
Python3
2021-12-06
0
540
题解 | #跳台阶#
来自专栏
# -*- coding:utf-8 -*- class Solution: def jumpFloor(self, number): # write code here ans=[0,1,2] for i in range(3,number+...
Python3
2021-11-29
0
340
题解 | #找出单向链表中的一个节点,该节点到尾指针的距离为K#
来自专栏
列表转链表,再双指针 class node: def __init__(self, data): self.val = data self.next = None class Solution: def __init__(self):...
Python3
链表
2021-11-23
0
534
题解 | #删除链表中重复的结点#
来自专栏
字典计数,数组转链表的解法 class Solution: def deleteDuplication(self , pHead: ListNode) -> ListNode: # write code here if not pHead: retur...
Python3
数组
链表
2021-11-23
0
380
题解 | #字符串分隔#
来自专栏
def get_ans(s): if not s: return None if len(s)==8: return s elif 0<len(s)<8: return add_zero(s) else: li=[] tup...
Python3
字符串
数组
2021-11-18
0
430
题解 | #字符串排序#
来自专栏
def get_ans(que_li): que_li=sorted(que_li) return que_li if __name__=='__main__': import sys lines = [] while True: line ...
Python3
数组
字符串
2021-11-18
0
389
题解 | #滑动窗口的最大值#
来自专栏
class Solution: def maxInWindows(self , nums: List[int], k: int) -> List[int]: # write code here if not nums or k==0: return []...
Python3
2021-11-12
0
408
题解 | #两个链表的第一个公共结点#
来自专栏
class Solution: def FindFirstCommonNode(self , pHead1 , pHead2 ): # write code here mark1,mark2=pHead1,pHead2 while mark1!...
Python3
链表
2021-11-12
0
339
题解 | #删除链表的节点#
来自专栏
class Solution: def deleteNode(self , head: ListNode, val: int) -> ListNode: # write code here # 极端情况 if not h...
Python3
链表
2021-11-12
0
409
题解 | #名字的漂亮度#
来自专栏
用python字典解决 def get_ans(s): dic={} for item in s: dic[item]=dic.get(item,0)+1 mark=sorted(dic.values(),reverse=True) mark=[mar...
Python3
2021-11-11
0
393
首页
上一页
1
2
3
4
5
下一页
末页