安静如鸡

  • Home
  • About Me
  • Contact Me
  • 东京女子篮球活动记录
Leetcode
Leetcode

253. Meeting Rooms II

Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. Example 1 Input: intervals = [[0,30],[5,10],[15,20]]Output: 2 Example 2 Input: intervals = [[7,10],[2,4]]Output: 1 C…

2026-10-23 0条评论 0人点赞 阅读全文
Leetcode

122. Best Time to Buy and Sell Stock II

You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can sell and buy the stock …

2026-09-23 0条评论 0人点赞 阅读全文
Leetcode

16. 3Sum Closest

Given an integer array nums of length n and an integer target, find three integers at distinct indices in nums such that the sum is closest to target. Return the sum of the three integers. You may assume t…

2026-08-31 0条评论 0人点赞 阅读全文
Leetcode

259. 3Sum Smaller

Given an array of n integers nums and an integer target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < targe…

2026-08-31 0条评论 0人点赞 阅读全文
Leetcode

17. Letter Combinations of a Phone Number

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. …

2026-08-30 0条评论 0人点赞 阅读全文
Leetcode

15. 3Sum

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. Example…

2026-08-05 0条评论 0人点赞 阅读全文
Leetcode

628. Maximum Product of Three Numbers

题干: Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: nums = [1,2,3,4] Output: 24 Example 3: Input: nums = [-1,-2,-3] Output: -6 Const…

2026-07-27 0条评论 0人点赞 阅读全文
Leetcode

2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assum…

2026-07-27 0条评论 0人点赞 阅读全文
Leetcode

1. Two Sum

这个题过于经典,是个easy题型,但是因为在3sum之前想复习一下所以先写一下思路。 首先这个followup看完就知道一开始肯定是有brute force解法的,两次for循环找到相加为target的就直接返回 现在我们看看如何能够不用两个for-loop。 首先就是我们需要找到两个数相加 = target,但是其实我们也可以反向想一下,只要找到一个数 = target - 另一个数就可以了 比较简单的想法是我们循环两次,第一次保存target-nums[i],第二次循环来寻找数列是否有一个数 = target-…

2026-07-14 0条评论 0人点赞 阅读全文
Leetcode

11. Container with most water

题解思路 这道题一开始肯定想到的思路是 Brute Force。 即循环两次,固定 end,然后让 i 从 0 遍历到 end-1,寻找最大的 Area。 面积计算公式为:Area=(end−i)×min⁡(height[i],height[end])Area=(end-i)\times\min(height[i],height[end]) 但是如此计算肯定会造成不必要的重复计算。 例如,如果 height[i]>height[i+1]height[i] > height[i+1] 那么继续向右移动 i…

2026-07-14 0条评论 0人点赞 阅读全文
12

Ellison

什么都懂点,什么都不精。属于混吃等死,享受生活,过一天算一天的享乐主义。喜欢电影,阅读,以及游戏和美食。

  • Leetcode
  • Tech
  • Unity
  • 写点东西
  • 呆驼
  • 小工具
  • 2026 年 10 月
  • 2026 年 9 月
  • 2026 年 8 月
  • 2026 年 7 月
  • 2026 年 4 月
  • 2025 年 8 月
  • 2025 年 3 月
  • 2024 年 8 月
  • 2024 年 7 月
  • 2024 年 5 月
  • 2024 年 4 月
  • 2024 年 3 月
  • 2024 年 1 月
  • 2023 年 10 月
  • 2023 年 9 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 3 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 4 月
  • 2021 年 6 月
  • 2021 年 5 月
最新 热点 随机
最新 热点 随机
253. Meeting Rooms II 122. Best Time to Buy and Sell Stock II 16. 3Sum Closest 259. 3Sum Smaller 17. Letter Combinations of a Phone Number Unity中的相机投影矩阵以及推导
253. Meeting Rooms II
16. 3Sum Closest Ubuntu 18 → 22 升级实录 【读书笔记】存在主义咖啡馆【WIP】 Apple Storeにアプリ認証について 【Unity小帖士】GameObject.CreatePrimitive创建的物体在打包后显示成粉色 git status 日文文件名乱码

COPYRIGHT © 2024 安静如鸡. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang