• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
鱼市口
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Leetcode刷题

Leetcode 55

摘要:class Solution: def canJump(self, nums: List[int]) -> bool: if len(nums) == 1:return True i = 0;j = i for i in range(100000): if j > i+nums[i]:pass el 阅读全文
posted @ 2023-08-28 01:47 鱼市口 阅读(34) 评论(0) 推荐(0)
Leetcode457

摘要:A very absurd description for this problem, but people can get the idea by looking at the examples.... bool circularArrayLoop(vector<int>& nums) { int 阅读全文
posted @ 2023-01-02 23:52 鱼市口 阅读(53) 评论(0) 推荐(0)
132pattern-Leetcode456

摘要:QUESTION: To search for a subsequence (s1,s2,s3) such that s1 < s3 < s2. INTUITION: Suppose we want to find a 123 sequence with s1 < s2 < s3, we just 阅读全文
posted @ 2023-01-02 23:40 鱼市口 阅读(51) 评论(0) 推荐(0)
Leetcode209

摘要:209. Minimum Size Subarray Sum i , s , l = 0, 0, 0 for j in range(len(nums)): s += nums[j] while (s >= target): l = j-i+1 if l == 0 else min(j-i+1, l) 阅读全文
posted @ 2022-12-30 11:54 鱼市口 阅读(43) 评论(0) 推荐(0)
Leetcode203

摘要:题意:去掉给定头ListNode* head 的单链表内 val 等于一个 给定val的节点并返回头 思路:此题删除链表中元素是很简单的,只需要让待删节点之前一个节点指向待删节点之后一个节点即可。 此题最大的问题就是,题目要求我们要返回新链表中的头结点,如果我们就采用仅仅复制头结点的方式(用H=he 阅读全文
posted @ 2022-12-29 01:17 鱼市口 阅读(61) 评论(0) 推荐(0)
Leetcode 199

摘要:199. Binary Tree Right Side View Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes yo 阅读全文
posted @ 2022-12-27 23:20 鱼市口 阅读(37) 评论(0) 推荐(0)
Leetcode207

摘要:numCourses->总的课程数目 Prerequisited->pair in a list denoting have to finish b to study a class Solution: def canFinish(self, numCourses: int, prerequisit 阅读全文
posted @ 2022-12-26 13:24 鱼市口 阅读(57) 评论(0) 推荐(0)
Leetcode61

摘要:!!Given the head of a linked list, rotate the list to the right by k places.!! # Definition for singly-linked list. # class ListNode(object): # def __ 阅读全文
posted @ 2022-12-24 23:27 鱼市口 阅读(37) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3