Skip to content

Commit

Permalink
leetcode: Update links to problem
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed May 7, 2024
1 parent f5dee29 commit 8920935
Show file tree
Hide file tree
Showing 47 changed files with 77 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/leetcode/0001.two-sum/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0001. 两数之和 Two Sum

[问题描述](../problems/0001.two-sum/content.html)
[问题描述](https://leetcode.com/problems/two-sum)

## 方法1, Brute Force

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0007.reverse-integer/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0007. 整数反转 Reverse Integer

[问题描述](../problems/0007.reverse-integer/content.html)
[问题描述](https://leetcode.com/problems/reverse-integer)

这是一个数学问题. 它考察的知识有这几个方面:

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0011.container-with-most-water/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0011. 盛最多水的容器 Container With Most Water

[问题描述](../problems/0011.container-with-most-water/content.html)
[问题描述](https://leetcode.com/problems/container-with-most-water)

这是一个典型的[靠拢型双指针问题](../../two-pointers/close-up.md).

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0012.integer-to-roman/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0012. 整数转罗马数字 Integer to Roman

[问题描述](../problems/0012.integer-to-roman/content.html)
[问题描述](https://leetcode.com/problems/integer-to-roman)

这也是字典映射问题, 目前实现了三种解法

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0013.roman-to-integer/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0013. 罗马数字转整数 Roman to Integer

[问题描述](../problems/0013.roman-to-integer/content.html)
[问题描述](https://leetcode.com/problems/roman-to-integer)

这是一个符号到整数的映射问题.

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0015.3sum/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0015. 三数之和 3Sum

[问题描述](../problems/0015.3sum/content.html)
[问题描述](https://leetcode.com/problems/3sum)

## 暴力法

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0021.merge-two-sorted-lists/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 0021.合并两个有序链表 Merge Two Sorted Lists

[问题描述](../problems/0021.merge-two-sorted-lists/content.html)
[问题描述](https://leetcode.com/problems/merge-two-sorted-lists)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0026. 删除有序数组中的重复项 Remove Duplicates from Sorted Array

[问题描述](../problems/0026.remove-duplicates-from-sorted-array/content.html)
[问题描述](https://leetcode.com/problems/remove-duplicates-from-sorted-array)

要注意的一点是, 这个数组已经是有序的了.

Expand Down
3 changes: 2 additions & 1 deletion src/leetcode/0031.next-permutation/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 0031. 下一个排列 Next Permutation

[问题描述](../problems/0031.next-permutation/content.html)
[问题描述](https://leetcode.com/problems/next-permutation)

TODO(Shaohua):
2 changes: 1 addition & 1 deletion src/leetcode/0039.combination-sum/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 0039.组合总和 Combination Sum

[问题描述](../problems/0039.combination-sum/content.html)
[问题描述](https://leetcode.com/problems/combination-sum)
5 changes: 5 additions & 0 deletions src/leetcode/0040.combination-sum-ii/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0040. 组合总和 II Combination Sum II

[问题描述](https://leetcode.com/problems/combination-sum-ii)

TODO(Shaohua):
4 changes: 3 additions & 1 deletion src/leetcode/0046.permutations/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0046. 全排列 Permutations

[问题描述](../problems/0046.permutations/content.html)
[问题描述](https://leetcode.com/problems/permutations)

TODO(Shaohua):
4 changes: 3 additions & 1 deletion src/leetcode/0047.permutations-ii/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# 0047. 全排列 II Permutations II
# 0047. 全排列 II Permutations II

[问题描述](https://leetcode.com/problems/permutations-ii)
2 changes: 1 addition & 1 deletion src/leetcode/0067.add-binary/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0067. 二进制求和 Add Binary

[问题描述](../problems/0067.add-binary/content.html)
[问题描述](https://leetcode.com/problems/add-binary)

这个问题考察两个方面的知识:

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0075.sort-colors/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0075. 颜色分类 Sort Colors

[问题描述](../problems/0075.sort-colors/content.html)
[问题描述](https://leetcode.com/problems/sort-colors)

## 靠拢型双指针

Expand Down
4 changes: 3 additions & 1 deletion src/leetcode/0078.subsets/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0078. 子集 Subsets

[问题描述](../problems/0078.subsets/content.html)
[问题描述](https://leetcode.com/problems/subsets)

TODO(Shaohua):
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0080. 删除排序数组中的重复项 II Remove Duplicates from Sorted Array II

[问题描述](../problems/0080.remove-duplicates-from-sorted-array-ii/content.html)
[问题描述](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii)

先分析这个题的条件:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0082. 删除排序链表中的重复元素 II Remove Duplicates from Sorted List II

[问题描述](../problems/0082.remove-duplicates-from-sorted-list-ii/content.html)
[问题描述](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii)

TODO(Shaohua):
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0083. 删除排序链表中的重复元素 Remove Duplicates from Sorted List

[问题描述](../problems/0083.remove-duplicates-from-sorted-list/content.html)
[问题描述](https://leetcode.com/problems/remove-duplicates-from-sorted-list)

TODO(Shaohua):
5 changes: 5 additions & 0 deletions src/leetcode/0088.merge-sorted-array/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0088. 合并两个有序数组 Merge Sorted Array

[问题描述](https://leetcode.com/problems/merge-sorted-array)

TODO(Shaohua):
4 changes: 3 additions & 1 deletion src/leetcode/0090.subsets-ii/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0090. 子集 II Subsets II

[问题描述](../problems/0090.subsets-ii/content.html)
[问题描述](https://leetcode.com/problems/subsets-ii/)

TODO(Shaohua):
2 changes: 1 addition & 1 deletion src/leetcode/0125.valid-palindrome/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0125. 验证回文串 Valid Palindrome

[问题描述](../problems/0125.valid-palindrome/content.html)
[问题描述](https://leetcode.com/problems/valid-palindrome)

## 靠拢型双指针

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0136.single-number/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0136. Single Number

[问题描述](../problems/0136.single-number/content.html)
[问题描述](https://leetcode.com/problems/single-number)

这个问题考察的是比特位异或操作中的一个重要特性: `A XOR A == 0`.

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0137.single-number-ii/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0137. Single Number II

[问题描述](../problems/0137.single-number-ii/content.html)
[问题描述](https://leetcode.com/problems/single-number-ii)

## 第一种思路, 使用字典来计数

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0167. 两数之和 II - 输入有序数组 Two Sum II - Input Array Is Sorted

[问题描述](../problems/0167.two-sum-ii-input-array-is-sorted/content.html)
[问题描述](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted)

## 靠拢型双指针

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0191.number-of-1-bits/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0191. Number of 1 Bits

[问题描述](../problems/0191.number-of-1-bits/content.html)
[问题描述](https://leetcode.com/problems/number-of-1-bits)

这个题目考察位操作的.

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0217.contains-duplicate/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0217. 存在重复元素 Contains Duplicate

[问题描述](../problems/0217.contains-duplicate/content.html)
[问题描述](https://leetcode.com/problems/contains-duplicate)

## 方法1, Brute Force

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0219.contains-duplicate-ii/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0219. 存在重复元素II Contains Duplicate II

[问题描述](../problems/0219.contains-duplicate-ii/content.html)
[问题描述](https://leetcode.com/problems/contains-duplicate-ii)

这个问题与 [0001. 两数之和 Two Sum](../0001.two-sum/index.md) 很相似,
而且其解法也都是一样的.
Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0231.power-of-two/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0231. 2的幂 Power of Two

[问题描述](../problems/0231.power-of-two/content.html)
[问题描述](https://leetcode.com/problems/power-of-two)

所有小于1的整数, 都不是2的次幂, 这样就可以过滤到一半的整数了.

Expand Down
2 changes: 2 additions & 0 deletions src/leetcode/0234.palindrome-linked-list/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0234. 回文链表 Palindrome Linked List

[问题描述](https://leetcode.com/problems/palindrome-linked-list)

TODO(shaohua)
2 changes: 1 addition & 1 deletion src/leetcode/0326.power-of-three/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0326. 3的幂 Power of Three

[问题描述](../problems/0326.power-of-three/content.html)
[问题描述](https://leetcode.com/problems/power-of-three)

可以看一下下面列出的相关问题, 这三个问题有相同的解法, 也有不同的解法.

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0338.counting-bits/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0338. 比特位计数 Counting Bits

[问题描述](../problems/0338.counting-bits/content.html)
[问题描述](https://leetcode.com/problems/counting-bits)

## 方法1, Brute Force

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0342.power-of-four/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0342. 4的幂 Power of Four

[问题描述](../problems/0342.power-of-four/content.html)
[问题描述](https://leetcode.com/problems/power-of-four)

这个问题与 [0231. 2 的幂 Power of Two](../0231.power-of-two/index.md) 很相似,
可以参考下它的解法.
Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0349.intersection-of-two-arrays/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0349. 两个数组的交集 Intersection of Two Arrays

[问题描述](../problems/0349.intersection-of-two-arrays/content.html)
[问题描述](https://leetcode.com/problems/intersection-of-two-arrays)

这是一个搜索问题, 这个问题的解法就比较多了.

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0350.intersection-of-two-arrays-ii/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0350. 两个数组的交集 II Intersection of Two Arrays II

[问题描述](../problems/0350.intersection-of-two-arrays-ii/content.html)
[问题描述](https://leetcode.com/problems/intersection-of-two-arrays-ii)

这类问题在 [0349. 两个数组的交集 Intersection of Two Arrays](../0349.intersection-of-two-arrays/index.md)
有好几个解法.
Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0485.max-consecutive-ones/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0485. 最大连续1的个数 Max Consecutive Ones

[问题描述](../problems/0485.max-consecutive-ones/content.html)
[问题描述](https://leetcode.com/problems/max-consecutive-ones)

## 滑动窗口

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0532.k-diff-pairs-in-an-array/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0532.数组中的数对 K-diff Pairs in an Array

[问题描述](../problems/0532.k-diff-pairs-in-an-array/content.html)
[问题描述](https://leetcode.com/problems/k-diff-pairs-in-an-array)

这是一个查找问题, 先思考一下处理查找问题的常用手段:

Expand Down
4 changes: 3 additions & 1 deletion src/leetcode/0679.24-game/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0679. 24 点游戏 24 Game

[问题描述](../problems/0679.24-game/content.html)
[问题描述](https://leetcode.com/problems/24-game)

TODO(Shaohua):
2 changes: 1 addition & 1 deletion src/leetcode/0680.valid-palindrome-ii/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0680. 验证回文串 II Valid Palindrome II

[问题描述](../problems/0680.valid-palindrome-ii/content.html)
[问题描述](https://leetcode.com/problems/valid-palindrome-ii)

在Rust中处理字符串, 远不如处理 `Vec<u8>` 或者 slice 简单, 所以这里我们在有必要时, 先把字符串
转换成数组: `let bytes = s.as_bytes();`
Expand Down
4 changes: 3 additions & 1 deletion src/leetcode/0707.design-linked-list/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0707. 设计链表 Design Linked List

[问题描述](../problems/0707.design-linked-list/content.html)
[问题描述](https://leetcode.com/problems/design-linked-list)

TODO(Shaohua):
2 changes: 1 addition & 1 deletion src/leetcode/0925.long-pressed-name/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0925. 长按键入 Long Pressed Name

[问题描述](../problems/0925.long-pressed-name/content.html)
[问题描述](https://leetcode.com/problems/long-pressed-name)

## 并行双指针

Expand Down
2 changes: 1 addition & 1 deletion src/leetcode/0977.squares-of-a-sorted-array/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 0977. 有序数组的平方 Squares of a Sorted Array

[问题描述](../problems/0977.squares-of-a-sorted-array/content.html)
[问题描述](https://leetcode.com/problems/squares-of-a-sorted-array)

TODO(Shaohua):
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 1498. 满足条件的子序列数目 Number of Subsequences That Satisfy the Given Sum Condition

[问题描述](https://leetcode.com/problems/number-of-subsequences-that-satisfy-the-given-sum-condition)

TODO(Shaohua):
2 changes: 1 addition & 1 deletion src/leetcode/1518.water-bottles/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 1518. 换水问题 Water Bottles

[问题描述](../problems/1518.water-bottles/content.html)
[问题描述](https://leetcode.com/problems/water-bottles)

所谓的兑换空瓶子, 问题就是 **商与余数(DivMod)** 的问题.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 1780. 判断一个数字是否可以表示成三的幂的和 Check if Number is a Sum of Powers of Three

[问题描述](../problems/1780.check-if-number-is-a-sum-of-powers-of-three/content.html)
[问题描述](https://leetcode.com/problems/check-if-number-is-a-sum-of-powers-of-three)

这个题目比较费脑子, 要反复仔细考虑题目里的细节, 这算是个数学问题.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 2108. 找出数组中的第一个回文字符串 Find First Palindromic String in the Array

[问题描述](../problems/2108.find-first-palindromic-string-in-the-array/content.html)
[问题描述](https://leetcode.com/problems/find-first-palindromic-string-in-the-array)

这道题与 [0125. 验证回文串 Valid Palindrome](../0125.valid-palindrome/index.md) 基本一致,
只是多了一个循环遍历, 将不再讲解.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 2119. 反转两次的数字 A Number After a Double Reversal

[问题描述](../problems/2119.a-number-after-a-double-reversal/content.html)
[问题描述](https://leetcode.com/problems/a-number-after-a-double-reversal)

仔细分析这个问题, 可以发现一个细节: 只要在反转时不丢弃任何一个数字, 才能保证两次反转后的整数值不变.

Expand Down

0 comments on commit 8920935

Please sign in to comment.