wuyijia

导航

2023年8月25日 #

基础题队列933、225、622、641

摘要: 933. 最近的请求次数 1 class RecentCounter: 2 3 def __init__(self): 4 self.q = collections.deque() 5 6 def ping(self, t: int) -> int: 7 self.q.append(t) 8 9 w 阅读全文

posted @ 2023-08-25 16:51 小吴要努力 阅读(12) 评论(0) 推荐(0) 编辑

基础题链表203、206

摘要: 203. 移除链表元素 也可以用栈解决:(程序员小熊) 1 # Definition for singly-linked list. 2 # class ListNode: 3 # def __init__(self, val=0, next=None): 4 # self.val = val 5 阅读全文

posted @ 2023-08-25 16:22 小吴要努力 阅读(3) 评论(0) 推荐(0) 编辑