|
35 | 35 |
|
36 | 36 | ## 两个数组的交集
|
37 | 37 |
|
38 |
| -[LeetCode链接](https://leetcode-cn.com/problems/intersection-of-two-arrays/) |
| 38 | +[LeetCode中文](https://leetcode-cn.com/problems/intersection-of-two-arrays/) |
| 39 | + |
| 40 | +[LeetCode英文](https://leetcode.com/problems/intersection-of-two-arrays/) |
39 | 41 |
|
40 | 42 | 给定两个数组,编写一个函数来计算它们的交集。
|
41 | 43 |
|
@@ -190,7 +192,9 @@ public:
|
190 | 192 |
|
191 | 193 | ## 两个数组的交集II
|
192 | 194 |
|
193 |
| -[LeetCode链接](https://leetcode-cn.com/problems/intersection-of-two-arrays-ii/) |
| 195 | +[LeetCode中文](https://leetcode-cn.com/problems/intersection-of-two-arrays-ii/) |
| 196 | +
|
| 197 | +[LeetCode英文](https://leetcode.com/problems/intersection-of-two-arrays-ii/) |
194 | 198 |
|
195 | 199 | 给定两个数组,编写一个函数来计算它们的交集。
|
196 | 200 |
|
@@ -333,7 +337,9 @@ public:
|
333 | 337 |
|
334 | 338 | ## 杨辉三角
|
335 | 339 |
|
336 |
| -[LeetCode链接](https://leetcode-cn.com/problems/pascals-triangle/) |
| 340 | +[LeetCode中文](https://leetcode-cn.com/problems/pascals-triangle/) |
| 341 | + |
| 342 | +[LeetCode英文](https://leetcode.com/problems/pascals-triangle/) |
337 | 343 |
|
338 | 344 | 给定一个非负整数 *numRows*,生成杨辉三角的前 *numRows* 行。
|
339 | 345 |
|
@@ -404,7 +410,9 @@ public:
|
404 | 410 |
|
405 | 411 | ## 求众数
|
406 | 412 |
|
407 |
| -[LeetCode链接](https://leetcode-cn.com/problems/majority-element/) |
| 413 | +[LeetCode中文](https://leetcode-cn.com/problems/majority-element/) |
| 414 | +
|
| 415 | +[LeetCode英文](https://leetcode.com/problems/majority-element/) |
408 | 416 |
|
409 | 417 | 给定一个大小为 n 的数组,找到其中的众数。众数是指在数组中出现次数**大于** ⌊ `n/2` ⌋ 的元素。
|
410 | 418 |
|
@@ -488,7 +496,9 @@ public:
|
488 | 496 |
|
489 | 497 | ## 移动零
|
490 | 498 |
|
491 |
| -[LeetCode链接](https://leetcode-cn.com/problems/move-zeroes/) |
| 499 | +[LeetCode中文](https://leetcode-cn.com/problems/move-zeroes/) |
| 500 | +
|
| 501 | +[LeetCode英文](https://leetcode.com/problems/move-zeroes/) |
492 | 502 |
|
493 | 503 | 给定一个数组 `nums`,编写一个函数将所有 `0` 移动到数组的末尾,同时保持非零元素的相对顺序。
|
494 | 504 |
|
@@ -538,7 +548,9 @@ public:
|
538 | 548 |
|
539 | 549 | ## 缺失数字
|
540 | 550 |
|
541 |
| -[LeetCode链接](https://leetcode-cn.com/problems/missing-number/) |
| 551 | +[LeetCode中文](https://leetcode-cn.com/problems/missing-number/) |
| 552 | + |
| 553 | +[LeetCode英文](https://leetcode.com/problems/missing-number/) |
542 | 554 |
|
543 | 555 | 给定一个包含 `0, 1, 2, ..., n` 中 `n` 个数的序列,找出 `0 .. n` 中没有出现在序列中的那个数。
|
544 | 556 |
|
@@ -604,7 +616,9 @@ public:
|
604 | 616 |
|
605 | 617 | ## 存在重复元素
|
606 | 618 |
|
607 |
| -[LeetCode链接](https://leetcode-cn.com/problems/contains-duplicate/) |
| 619 | +[LeetCode中文](https://leetcode-cn.com/problems/contains-duplicate/) |
| 620 | + |
| 621 | +[LeetCode英文](https://leetcode.com/problems/contains-duplicate/) |
608 | 622 |
|
609 | 623 | 给定一个整数数组,判断是否存在重复元素。
|
610 | 624 |
|
@@ -655,7 +669,9 @@ public:
|
655 | 669 |
|
656 | 670 | ## 两数之和
|
657 | 671 |
|
658 |
| -[LeetCode链接](https://leetcode-cn.com/problems/two-sum/) |
| 672 | +[LeetCode中文](https://leetcode-cn.com/problems/two-sum/) |
| 673 | + |
| 674 | +[LeetCode英文](https://leetcode.com/problems/two-sum/) |
659 | 675 |
|
660 | 676 | 给定一个整数数组 `nums` 和一个目标值 `target`,请你在该数组中找出和为目标值的那 **两个** 整数,并返回他们的数组下标。
|
661 | 677 |
|
@@ -699,7 +715,9 @@ public:
|
699 | 715 |
|
700 | 716 | ## 最接近的三数之和
|
701 | 717 |
|
702 |
| -[LeetCode链接](https://leetcode-cn.com/problems/3sum-closest/) |
| 718 | +[LeetCode中文](https://leetcode-cn.com/problems/3sum-closest/) |
| 719 | +
|
| 720 | +[LeetCode英文](https://leetcode.com/problems/3sum-closest/) |
703 | 721 |
|
704 | 722 | 给定一个包括 *n* 个整数的数组 `nums` 和 一个目标值 `target`。找出 `nums` 中的三个整数,使得它们的和与 `target` 最接近。返回这三个数的和。假定每组输入只存在唯一答案。
|
705 | 723 | ```
|
@@ -771,7 +789,9 @@ public:
|
771 | 789 |
|
772 | 790 | ## 三数之和
|
773 | 791 |
|
774 |
| -[LeetCode链接](https://leetcode-cn.com/problems/3sum) |
| 792 | +[LeetCode中文](https://leetcode-cn.com/problems/3sum) |
| 793 | + |
| 794 | +[LeetCode英文](https://leetcode.com/problems/3sum) |
775 | 795 |
|
776 | 796 | 给定一个包含 `n` 个整数的数组 `nums`,判断 `nums` 中是否存在三个元素 `a`,`b`,`c` ,使得 a + b + c = 0 ?找出所有满足条件且不重复的三元组。
|
777 | 797 |
|
@@ -849,7 +869,9 @@ public:
|
849 | 869 |
|
850 | 870 | ## 删除排序数组中的重复项
|
851 | 871 |
|
852 |
| -[LeetCode链接](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/) |
| 872 | +[LeetCode中文](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/) |
| 873 | + |
| 874 | +[LeetCode英文](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) |
853 | 875 |
|
854 | 876 | 给定一个排序数组,你需要在**原地**删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。
|
855 | 877 |
|
@@ -907,7 +929,9 @@ public:
|
907 | 929 |
|
908 | 930 | ## 合并两个有序数组
|
909 | 931 |
|
910 |
| -[LeetCode链接](https://leetcode-cn.com/problems/merge-sorted-array/) |
| 932 | +[LeetCode中文](https://leetcode-cn.com/problems/merge-sorted-array/) |
| 933 | +
|
| 934 | +[LeetCode英文](https://leetcode.com/problems/merge-sorted-array/) |
911 | 935 |
|
912 | 936 | 给定两个有序整数数组 `nums1` 和 `nums2`,将 `nums2` 合并到 `nums1` 中,使得 `num1` 成为一个有序数组。
|
913 | 937 |
|
@@ -963,7 +987,9 @@ public:
|
963 | 987 |
|
964 | 988 | ## 旋转数组
|
965 | 989 |
|
966 |
| -[LeetCode链接](https://leetcode-cn.com/problems/rotate-array/) |
| 990 | +[LeetCode中文](https://leetcode-cn.com/problems/rotate-array/) |
| 991 | + |
| 992 | +[LeetCode英文](https://leetcode.com/problems/rotate-array/) |
967 | 993 |
|
968 | 994 | 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。
|
969 | 995 |
|
@@ -1050,7 +1076,9 @@ public:
|
1050 | 1076 |
|
1051 | 1077 | ## 螺旋矩阵
|
1052 | 1078 |
|
1053 |
| -[LeetCode链接](https://leetcode-cn.com/problems/spiral-matrix/) |
| 1079 | +[LeetCode中文](https://leetcode-cn.com/problems/spiral-matrix/) |
| 1080 | +
|
| 1081 | +[LeetCode英文](https://leetcode.com/problems/spiral-matrix/) |
1054 | 1082 |
|
1055 | 1083 | 给定一个包含 `m x n` 个元素的矩阵(`m` 行, `n` 列),请按照顺时针螺旋顺序,返回矩阵中的所有元素。
|
1056 | 1084 |
|
@@ -1149,7 +1177,9 @@ public:
|
1149 | 1177 |
|
1150 | 1178 | ## 螺旋矩阵II
|
1151 | 1179 |
|
1152 |
| -[LeetCode链接](https://leetcode-cn.com/problems/spiral-matrix-ii/) |
| 1180 | +[LeetCode中文](https://leetcode-cn.com/problems/spiral-matrix-ii/) |
| 1181 | +
|
| 1182 | +[LeetCode英文](https://leetcode.com/problems/spiral-matrix-ii/) |
1153 | 1183 |
|
1154 | 1184 | 给定一个正整数 `n`,生成一个包含 1 到 `n<sup>2</sup>` 所有元素,且元素按顺时针顺序螺旋排列的正方形矩阵。
|
1155 | 1185 |
|
@@ -1242,7 +1272,9 @@ private:
|
1242 | 1272 |
|
1243 | 1273 | ## 旋转图像
|
1244 | 1274 |
|
1245 |
| -[LeetCode链接](https://leetcode-cn.com/problems/rotate-image/) |
| 1275 | +[LeetCode中文](https://leetcode-cn.com/problems/rotate-image/) |
| 1276 | +
|
| 1277 | +[LeetCode英文](https://leetcode.com/problems/rotate-image/) |
1246 | 1278 |
|
1247 | 1279 | 给定一个 `n × n` 的二维矩阵表示一个图像。
|
1248 | 1280 |
|
@@ -1352,7 +1384,9 @@ public:
|
1352 | 1384 |
|
1353 | 1385 | ## 寻找重复数
|
1354 | 1386 |
|
1355 |
| -[LeetCode链接](https://leetcode-cn.com/problems/find-the-duplicate-number/) |
| 1387 | +[LeetCode中文](https://leetcode-cn.com/problems/find-the-duplicate-number/) |
| 1388 | +
|
| 1389 | +[LeetCode英文](https://leetcode.com/problems/find-the-duplicate-number/) |
1356 | 1390 |
|
1357 | 1391 | 给定一个包含 `n + 1` 个整数的数组 `nums`,其数字都在 1 到 `n` 之间(包括 1 和 `n`),可知至少存在一个重复的整数。假设只有一个重复的整数,找出这个重复的数。
|
1358 | 1392 |
|
@@ -1414,7 +1448,9 @@ public:
|
1414 | 1448 |
|
1415 | 1449 | ## 除自身以外数组的乘积
|
1416 | 1450 |
|
1417 |
| -[LeetCode链接](https://leetcode-cn.com/problems/product-of-array-except-self/) |
| 1451 | +[LeetCode中文](https://leetcode-cn.com/problems/product-of-array-except-self/) |
| 1452 | + |
| 1453 | +[LeetCode英文](https://leetcode.com/problems/product-of-array-except-self/) |
1418 | 1454 |
|
1419 | 1455 | 给定长度为 `n` 的整数数组 `nums`,其中 `n > 1`,返回输出数组 `output` ,其中 `output[i]` 等于 `nums` 中除 `nums[i]` 之外其余各元素的乘积。
|
1420 | 1456 |
|
@@ -1511,7 +1547,9 @@ public:
|
1511 | 1547 |
|
1512 | 1548 | ## 矩阵置零
|
1513 | 1549 |
|
1514 |
| -[LeetCode链接](https://leetcode-cn.com/problems/set-matrix-zeroes) |
| 1550 | +[LeetCode中文](https://leetcode-cn.com/problems/set-matrix-zeroes) |
| 1551 | +
|
| 1552 | +[LeetCode英文](https://leetcode.com/problems/set-matrix-zeroes) |
1515 | 1553 |
|
1516 | 1554 | 给定一个 `m x n` 的矩阵,如果一个元素为 0,则将其所在行和列的所有元素都设为 0。请使用原地算法。
|
1517 | 1555 |
|
@@ -1594,7 +1632,9 @@ public:
|
1594 | 1632 |
|
1595 | 1633 | ## 盛最多水的容器
|
1596 | 1634 |
|
1597 |
| -[LeetCode链接](https://leetcode-cn.com/problems/container-with-most-water) |
| 1635 | +[LeetCode中文](https://leetcode-cn.com/problems/container-with-most-water) |
| 1636 | +
|
| 1637 | +[LeetCode英文](https://leetcode.com/problems/container-with-most-water) |
1598 | 1638 |
|
1599 | 1639 | 给定 n 个非负整数 *a1,a2,...,an*,每个数代表坐标中的一个点 *(i, ai)* 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 *(i, ai)* 和 *(i, 0)* 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
|
1600 | 1640 |
|
@@ -1656,7 +1696,9 @@ public:
|
1656 | 1696 |
|
1657 | 1697 | ## 合并区间
|
1658 | 1698 |
|
1659 |
| -[LeetCode链接](https://leetcode-cn.com/problems/merge-intervals) |
| 1699 | +[LeetCode中文](https://leetcode-cn.com/problems/merge-intervals) |
| 1700 | + |
| 1701 | +[LeetCode英文](https://leetcode.com/problems/merge-intervals) |
1660 | 1702 |
|
1661 | 1703 | 给出一个区间的集合,请合并所有重叠的区间。
|
1662 | 1704 |
|
@@ -1728,7 +1770,9 @@ public:
|
1728 | 1770 |
|
1729 | 1771 | ## 下一个排列
|
1730 | 1772 |
|
1731 |
| -[LeetCode链接](https://leetcode-cn.com/problems/next-permutation) |
| 1773 | +[LeetCode中文](https://leetcode-cn.com/problems/next-permutation) |
| 1774 | + |
| 1775 | +[LeetCode英文](https://leetcode.com/problems/next-permutation) |
1732 | 1776 |
|
1733 | 1777 | 实现获取下一个排列的函数,算法需要将给定数字序列重新排列成字典序中下一个更大的排列。
|
1734 | 1778 |
|
@@ -1812,7 +1856,9 @@ public:
|
1812 | 1856 |
|
1813 | 1857 | ## 缺失的第一个正数
|
1814 | 1858 |
|
1815 |
| -[LeetCode链接](https://leetcode-cn.com/problems/first-missing-positive) |
| 1859 | +[LeetCode中文](https://leetcode-cn.com/problems/first-missing-positive) |
| 1860 | +
|
| 1861 | +[LeetCode英文](https://leetcode.com/problems/first-missing-positive) |
1816 | 1862 |
|
1817 | 1863 | 给定一个未排序的整数数组,找出其中没有出现的最小的正整数。
|
1818 | 1864 |
|
@@ -1919,7 +1965,9 @@ public:
|
1919 | 1965 |
|
1920 | 1966 | ## 判断子序列
|
1921 | 1967 |
|
1922 |
| -[LeetCode链接](https://leetcode-cn.com/problems/is-subsequence) |
| 1968 | +[LeetCode中文](https://leetcode-cn.com/problems/is-subsequence) |
| 1969 | +
|
| 1970 | +[LeetCode英文](https://leetcode.com/problems/is-subsequence) |
1923 | 1971 |
|
1924 | 1972 | 给定字符串 `s` 和 `t` ,判断 `s` 是否为 `t` 的子序列。
|
1925 | 1973 |
|
@@ -1985,7 +2033,9 @@ public:
|
1985 | 2033 |
|
1986 | 2034 | ## 搜索二维矩阵II
|
1987 | 2035 |
|
1988 |
| -[LeetCode链接](https://leetcode-cn.com/problems/search-a-2d-matrix-ii/) |
| 2036 | +[LeetCode中文](https://leetcode-cn.com/problems/search-a-2d-matrix-ii/) |
| 2037 | + |
| 2038 | +[LeetCode英文](https://leetcode.com/problems/search-a-2d-matrix-ii/) |
1989 | 2039 |
|
1990 | 2040 | 编写一个高效的算法来搜索 *m* x *n* 矩阵 matrix 中的一个目标值 target。该矩阵具有以下特性:
|
1991 | 2041 |
|
@@ -2057,7 +2107,9 @@ public:
|
2057 | 2107 |
|
2058 | 2108 | ## 有效的数独
|
2059 | 2109 |
|
2060 |
| -[LeetCode链接](https://leetcode-cn.com/problems/valid-sudoku/) |
| 2110 | +[LeetCode中文](https://leetcode-cn.com/problems/valid-sudoku/) |
| 2111 | +
|
| 2112 | +[LeetCode英文](https://leetcode.com/problems/valid-sudoku/) |
2061 | 2113 |
|
2062 | 2114 | 判断一个 9x9 的数独是否有效。只需要**根据以下规则**,验证已经填入的数字是否有效即可。
|
2063 | 2115 |
|
|
0 commit comments