xinyu04

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

2023年8月8日 #

LeetCode 16. 3Sum Closest 双指针+排序

摘要: Given an integer array `nums` of length n and an integer `target`, find three integers in nums such that the sum is closest to `target`. Return the su 阅读全文

posted @ 2023-08-08 17:18 Blackzxy 阅读(6) 评论(0) 推荐(0) 编辑

2023年7月28日 #

LeetCode 239. Sliding Window Maximum 单调队列

摘要: You are given an array of integers `nums`, there is a sliding window of size `k` which is moving from the very left of the array to the very right. Yo 阅读全文

posted @ 2023-07-28 21:17 Blackzxy 阅读(6) 评论(0) 推荐(0) 编辑

2023年7月23日 #

LeetCode 438. Find All Anagrams in a String 滑动窗口

摘要: Given two strings `s` and `p`, return an array of all the start indices of `p`'s anagrams in s. You may return the answer in any order. An Anagram is 阅读全文

posted @ 2023-07-23 22:31 Blackzxy 阅读(3) 评论(0) 推荐(0) 编辑

2023年7月22日 #

LeetCode 3. Longest Substring Without Repeating Characters 滑动窗口

摘要: Given a string `s`, find the length of the longest substring without repeating characters. ## Solution 用一个 dictdict 来映射字符的次数。然后用 leftleft, rightright 来决定wind 阅读全文

posted @ 2023-07-22 23:51 Blackzxy 阅读(4) 评论(0) 推荐(0) 编辑

2023年7月19日 #

LeetCode 1201. Ugly Number III 数学+二分答案

摘要: An ugly number is a positive integer that is divisible by aa, bb, or cc. Given four integers nn, aa, bb, and cc, return the nnth ugly number. 阅读全文

posted @ 2023-07-19 20:57 Blackzxy 阅读(4) 评论(0) 推荐(0) 编辑

LeetCode 875. Koko Eating Bananas 二分答案

摘要: Koko loves to eat bananas. There are nn piles of bananas, the iith pile has piles[i]piles[i] bananas. The guards have gone and will come back in `h` hours 阅读全文

posted @ 2023-07-19 19:43 Blackzxy 阅读(6) 评论(0) 推荐(0) 编辑

LeetCode 1011. Capacity To Ship Packages Within D Days 二分答案

摘要: A conveyor belt has packages that must be shipped from one port to another within `days` days. The ith package on the conveyor belt has a weight of $w 阅读全文

posted @ 2023-07-19 16:34 Blackzxy 阅读(7) 评论(0) 推荐(0) 编辑

2023年7月18日 #

LeetCode 852. Peak Index in a Mountain Array 二分

摘要: An array arr a mountain if the following properties hold: * `arr.length` >= 3 * There exists some i with `0 arr[i + 1] > ... > arr[arr.length - 1] ``` 阅读全文

posted @ 2023-07-18 22:31 Blackzxy 阅读(8) 评论(0) 推荐(0) 编辑

2023年7月16日 #

LeetCode 793. Preimage Size of Factorial Zeroes Function 二分

摘要: Let `f(x)` be the number of zeroes at the end of x!. Recall that x!=123...xx!=123...x and by convention, 0! = 1. For example,` f(3) = 0` because 阅读全文

posted @ 2023-07-16 23:15 Blackzxy 阅读(5) 评论(0) 推荐(0) 编辑

2023年7月15日 #

LeetCode 658. Find K Closest Elements 二分+双指针

摘要: Given a sorted integer array `arr`, two integers `k` and `x`, return the `k` closest integers to `x` in the array. The result should also be sorted in 阅读全文

posted @ 2023-07-15 22:45 Blackzxy 阅读(8) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示