auto commit
This commit is contained in:
parent
e4822f572d
commit
756e99ee4e
|
@ -1,30 +1,28 @@
|
||||||
<!-- GFM-TOC -->
|
<!-- GFM-TOC -->
|
||||||
* [素数分解](#素数分解)
|
* [素数分解](#素数分解)
|
||||||
* [整除](#整除)
|
* [整除](#整除)
|
||||||
* [最大公约数最小公倍数](#最大公约数最小公倍数)
|
* [最大公约数最小公倍数](#最大公约数最小公倍数)
|
||||||
* [生成素数序列](#生成素数序列)
|
* [1. 生成素数序列](#1-生成素数序列)
|
||||||
* [最大公约数](#最大公约数)
|
* [2. 最大公约数](#2-最大公约数)
|
||||||
* [使用位操作和减法求解最大公约数](#使用位操作和减法求解最大公约数)
|
* [3. 使用位操作和减法求解最大公约数](#3-使用位操作和减法求解最大公约数)
|
||||||
* [进制转换](#进制转换)
|
* [进制转换](#进制转换)
|
||||||
* [7 进制](#7-进制)
|
* [1. 7 进制](#1-7-进制)
|
||||||
* [16 进制](#16-进制)
|
* [2. 16 进制](#2-16-进制)
|
||||||
* [26 进制](#26-进制)
|
* [3. 26 进制](#3-26-进制)
|
||||||
* [阶乘](#阶乘)
|
* [阶乘](#阶乘)
|
||||||
* [统计阶乘尾部有多少个 0](#统计阶乘尾部有多少个-0)
|
* [1. 统计阶乘尾部有多少个 0](#1-统计阶乘尾部有多少个-0)
|
||||||
* [字符串加法减法](#字符串加法减法)
|
* [字符串加法减法](#字符串加法减法)
|
||||||
* [二进制加法](#二进制加法)
|
* [1. 二进制加法](#1-二进制加法)
|
||||||
* [字符串加法](#字符串加法)
|
* [2. 字符串加法](#2-字符串加法)
|
||||||
* [相遇问题](#相遇问题)
|
* [相遇问题](#相遇问题)
|
||||||
* [改变数组元素使所有的数组元素都相等](#改变数组元素使所有的数组元素都相等)
|
* [1. 改变数组元素使所有的数组元素都相等](#1-改变数组元素使所有的数组元素都相等)
|
||||||
* [解法 1](#解法-1)
|
|
||||||
* [解法 2](#解法-2)
|
|
||||||
* [多数投票问题](#多数投票问题)
|
* [多数投票问题](#多数投票问题)
|
||||||
* [数组中出现次数多于 n / 2 的元素](#数组中出现次数多于-n--2-的元素)
|
* [1. 数组中出现次数多于 n / 2 的元素](#1-数组中出现次数多于-n--2-的元素)
|
||||||
* [其它](#其它)
|
* [其它](#其它)
|
||||||
* [平方数](#平方数)
|
* [1. 平方数](#1-平方数)
|
||||||
* [3 的 n 次方](#3-的-n-次方)
|
* [2. 3 的 n 次方](#2-3-的-n-次方)
|
||||||
* [乘积数组](#乘积数组)
|
* [3. 乘积数组](#3-乘积数组)
|
||||||
* [找出数组中的乘积最大的三个数](#找出数组中的乘积最大的三个数)
|
* [4. 找出数组中的乘积最大的三个数](#4-找出数组中的乘积最大的三个数)
|
||||||
<!-- GFM-TOC -->
|
<!-- GFM-TOC -->
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,13 +38,13 @@
|
||||||
|
|
||||||
如果 x 整除 y(y mod x == 0),则对于所有 i,mi <= ni。
|
如果 x 整除 y(y mod x == 0),则对于所有 i,mi <= ni。
|
||||||
|
|
||||||
## 最大公约数最小公倍数
|
# 最大公约数最小公倍数
|
||||||
|
|
||||||
x 和 y 的最大公约数为:gcd(x,y) = 2<sup>min(m0,n0)</sup> \* 3<sup>min(m1,n1)</sup> \* 5<sup>min(m2,n2)</sup> \* ...
|
x 和 y 的最大公约数为:gcd(x,y) = 2<sup>min(m0,n0)</sup> \* 3<sup>min(m1,n1)</sup> \* 5<sup>min(m2,n2)</sup> \* ...
|
||||||
|
|
||||||
x 和 y 的最小公倍数为:lcm(x,y) = 2<sup>max(m0,n0)</sup> \* 3<sup>max(m1,n1)</sup> \* 5<sup>max(m2,n2)</sup> \* ...
|
x 和 y 的最小公倍数为:lcm(x,y) = 2<sup>max(m0,n0)</sup> \* 3<sup>max(m1,n1)</sup> \* 5<sup>max(m2,n2)</sup> \* ...
|
||||||
|
|
||||||
## 生成素数序列
|
## 1. 生成素数序列
|
||||||
|
|
||||||
[204. Count Primes (Easy)](https://leetcode.com/problems/count-primes/description/)
|
[204. Count Primes (Easy)](https://leetcode.com/problems/count-primes/description/)
|
||||||
|
|
||||||
|
@ -70,7 +68,7 @@ public int countPrimes(int n) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 最大公约数
|
## 2. 最大公约数
|
||||||
|
|
||||||
```java
|
```java
|
||||||
int gcd(int a, int b) {
|
int gcd(int a, int b) {
|
||||||
|
@ -86,7 +84,7 @@ int lcm(int a, int b) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用位操作和减法求解最大公约数
|
## 3. 使用位操作和减法求解最大公约数
|
||||||
|
|
||||||
[编程之美:2.7](#)
|
[编程之美:2.7](#)
|
||||||
|
|
||||||
|
@ -122,7 +120,7 @@ public int gcd(int a, int b) {
|
||||||
|
|
||||||
# 进制转换
|
# 进制转换
|
||||||
|
|
||||||
## 7 进制
|
## 1. 7 进制
|
||||||
|
|
||||||
[504. Base 7 (Easy)](https://leetcode.com/problems/base-7/description/)
|
[504. Base 7 (Easy)](https://leetcode.com/problems/base-7/description/)
|
||||||
|
|
||||||
|
@ -153,7 +151,7 @@ public String convertToBase7(int num) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 16 进制
|
## 2. 16 进制
|
||||||
|
|
||||||
[405. Convert a Number to Hexadecimal (Easy)](https://leetcode.com/problems/convert-a-number-to-hexadecimal/description/)
|
[405. Convert a Number to Hexadecimal (Easy)](https://leetcode.com/problems/convert-a-number-to-hexadecimal/description/)
|
||||||
|
|
||||||
|
@ -186,7 +184,7 @@ public String toHex(int num) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 26 进制
|
## 3. 26 进制
|
||||||
|
|
||||||
[168. Excel Sheet Column Title (Easy)](https://leetcode.com/problems/excel-sheet-column-title/description/)
|
[168. Excel Sheet Column Title (Easy)](https://leetcode.com/problems/excel-sheet-column-title/description/)
|
||||||
|
|
||||||
|
@ -214,7 +212,7 @@ public String convertToTitle(int n) {
|
||||||
|
|
||||||
# 阶乘
|
# 阶乘
|
||||||
|
|
||||||
## 统计阶乘尾部有多少个 0
|
## 1. 统计阶乘尾部有多少个 0
|
||||||
|
|
||||||
[172. Factorial Trailing Zeroes (Easy)](https://leetcode.com/problems/factorial-trailing-zeroes/description/)
|
[172. Factorial Trailing Zeroes (Easy)](https://leetcode.com/problems/factorial-trailing-zeroes/description/)
|
||||||
|
|
||||||
|
@ -232,7 +230,7 @@ public int trailingZeroes(int n) {
|
||||||
|
|
||||||
# 字符串加法减法
|
# 字符串加法减法
|
||||||
|
|
||||||
## 二进制加法
|
## 1. 二进制加法
|
||||||
|
|
||||||
[67. Add Binary (Easy)](https://leetcode.com/problems/add-binary/description/)
|
[67. Add Binary (Easy)](https://leetcode.com/problems/add-binary/description/)
|
||||||
|
|
||||||
|
@ -260,7 +258,7 @@ public String addBinary(String a, String b) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 字符串加法
|
## 2. 字符串加法
|
||||||
|
|
||||||
[415. Add Strings (Easy)](https://leetcode.com/problems/add-strings/description/)
|
[415. Add Strings (Easy)](https://leetcode.com/problems/add-strings/description/)
|
||||||
|
|
||||||
|
@ -282,7 +280,7 @@ public String addStrings(String num1, String num2) {
|
||||||
|
|
||||||
# 相遇问题
|
# 相遇问题
|
||||||
|
|
||||||
## 改变数组元素使所有的数组元素都相等
|
## 1. 改变数组元素使所有的数组元素都相等
|
||||||
|
|
||||||
[462. Minimum Moves to Equal Array Elements II (Medium)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/description/)
|
[462. Minimum Moves to Equal Array Elements II (Medium)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/description/)
|
||||||
|
|
||||||
|
@ -307,7 +305,7 @@ Only two moves are needed (remember each move increments or decrements one eleme
|
||||||
|
|
||||||
设数组长度为 N,则可以找到 N/2 对 a 和 b 的组合,使它们都移动到 m 的位置。
|
设数组长度为 N,则可以找到 N/2 对 a 和 b 的组合,使它们都移动到 m 的位置。
|
||||||
|
|
||||||
## 解法 1
|
**解法 1**
|
||||||
|
|
||||||
先排序,时间复杂度:O(NlogN)
|
先排序,时间复杂度:O(NlogN)
|
||||||
|
|
||||||
|
@ -325,7 +323,7 @@ public int minMoves2(int[] nums) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 解法 2
|
**解法 2**
|
||||||
|
|
||||||
使用快速选择找到中位数,时间复杂度 O(N)
|
使用快速选择找到中位数,时间复杂度 O(N)
|
||||||
|
|
||||||
|
@ -378,7 +376,7 @@ private void swap(int[] nums, int i, int j) {
|
||||||
|
|
||||||
# 多数投票问题
|
# 多数投票问题
|
||||||
|
|
||||||
## 数组中出现次数多于 n / 2 的元素
|
## 1. 数组中出现次数多于 n / 2 的元素
|
||||||
|
|
||||||
[169. Majority Element (Easy)](https://leetcode.com/problems/majority-element/description/)
|
[169. Majority Element (Easy)](https://leetcode.com/problems/majority-element/description/)
|
||||||
|
|
||||||
|
@ -406,7 +404,7 @@ public int majorityElement(int[] nums) {
|
||||||
|
|
||||||
# 其它
|
# 其它
|
||||||
|
|
||||||
## 平方数
|
## 1. 平方数
|
||||||
|
|
||||||
[367. Valid Perfect Square (Easy)](https://leetcode.com/problems/valid-perfect-square/description/)
|
[367. Valid Perfect Square (Easy)](https://leetcode.com/problems/valid-perfect-square/description/)
|
||||||
|
|
||||||
|
@ -432,7 +430,7 @@ public boolean isPerfectSquare(int num) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3 的 n 次方
|
## 2. 3 的 n 次方
|
||||||
|
|
||||||
[326. Power of Three (Easy)](https://leetcode.com/problems/power-of-three/description/)
|
[326. Power of Three (Easy)](https://leetcode.com/problems/power-of-three/description/)
|
||||||
|
|
||||||
|
@ -442,7 +440,7 @@ public boolean isPowerOfThree(int n) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 乘积数组
|
## 3. 乘积数组
|
||||||
|
|
||||||
[238. Product of Array Except Self (Medium)](https://leetcode.com/problems/product-of-array-except-self/description/)
|
[238. Product of Array Except Self (Medium)](https://leetcode.com/problems/product-of-array-except-self/description/)
|
||||||
|
|
||||||
|
@ -473,7 +471,7 @@ public int[] productExceptSelf(int[] nums) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 找出数组中的乘积最大的三个数
|
## 4. 找出数组中的乘积最大的三个数
|
||||||
|
|
||||||
[628. Maximum Product of Three Numbers (Easy)](https://leetcode.com/problems/maximum-product-of-three-numbers/description/)
|
[628. Maximum Product of Three Numbers (Easy)](https://leetcode.com/problems/maximum-product-of-three-numbers/description/)
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,28 @@
|
||||||
<!-- GFM-TOC -->
|
<!-- GFM-TOC -->
|
||||||
* [素数分解](#素数分解)
|
* [素数分解](#素数分解)
|
||||||
* [整除](#整除)
|
* [整除](#整除)
|
||||||
* [最大公约数最小公倍数](#最大公约数最小公倍数)
|
* [最大公约数最小公倍数](#最大公约数最小公倍数)
|
||||||
* [生成素数序列](#生成素数序列)
|
* [1. 生成素数序列](#1-生成素数序列)
|
||||||
* [最大公约数](#最大公约数)
|
* [2. 最大公约数](#2-最大公约数)
|
||||||
* [使用位操作和减法求解最大公约数](#使用位操作和减法求解最大公约数)
|
* [3. 使用位操作和减法求解最大公约数](#3-使用位操作和减法求解最大公约数)
|
||||||
* [进制转换](#进制转换)
|
* [进制转换](#进制转换)
|
||||||
* [7 进制](#7-进制)
|
* [1. 7 进制](#1-7-进制)
|
||||||
* [16 进制](#16-进制)
|
* [2. 16 进制](#2-16-进制)
|
||||||
* [26 进制](#26-进制)
|
* [3. 26 进制](#3-26-进制)
|
||||||
* [阶乘](#阶乘)
|
* [阶乘](#阶乘)
|
||||||
* [统计阶乘尾部有多少个 0](#统计阶乘尾部有多少个-0)
|
* [1. 统计阶乘尾部有多少个 0](#1-统计阶乘尾部有多少个-0)
|
||||||
* [字符串加法减法](#字符串加法减法)
|
* [字符串加法减法](#字符串加法减法)
|
||||||
* [二进制加法](#二进制加法)
|
* [1. 二进制加法](#1-二进制加法)
|
||||||
* [字符串加法](#字符串加法)
|
* [2. 字符串加法](#2-字符串加法)
|
||||||
* [相遇问题](#相遇问题)
|
* [相遇问题](#相遇问题)
|
||||||
* [改变数组元素使所有的数组元素都相等](#改变数组元素使所有的数组元素都相等)
|
* [1. 改变数组元素使所有的数组元素都相等](#1-改变数组元素使所有的数组元素都相等)
|
||||||
* [解法 1](#解法-1)
|
|
||||||
* [解法 2](#解法-2)
|
|
||||||
* [多数投票问题](#多数投票问题)
|
* [多数投票问题](#多数投票问题)
|
||||||
* [数组中出现次数多于 n / 2 的元素](#数组中出现次数多于-n--2-的元素)
|
* [1. 数组中出现次数多于 n / 2 的元素](#1-数组中出现次数多于-n--2-的元素)
|
||||||
* [其它](#其它)
|
* [其它](#其它)
|
||||||
* [平方数](#平方数)
|
* [1. 平方数](#1-平方数)
|
||||||
* [3 的 n 次方](#3-的-n-次方)
|
* [2. 3 的 n 次方](#2-3-的-n-次方)
|
||||||
* [乘积数组](#乘积数组)
|
* [3. 乘积数组](#3-乘积数组)
|
||||||
* [找出数组中的乘积最大的三个数](#找出数组中的乘积最大的三个数)
|
* [4. 找出数组中的乘积最大的三个数](#4-找出数组中的乘积最大的三个数)
|
||||||
<!-- GFM-TOC -->
|
<!-- GFM-TOC -->
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,13 +38,13 @@
|
||||||
|
|
||||||
如果 x 整除 y(y mod x == 0),则对于所有 i,mi <= ni。
|
如果 x 整除 y(y mod x == 0),则对于所有 i,mi <= ni。
|
||||||
|
|
||||||
## 最大公约数最小公倍数
|
# 最大公约数最小公倍数
|
||||||
|
|
||||||
x 和 y 的最大公约数为:gcd(x,y) = 2<sup>min(m0,n0)</sup> \* 3<sup>min(m1,n1)</sup> \* 5<sup>min(m2,n2)</sup> \* ...
|
x 和 y 的最大公约数为:gcd(x,y) = 2<sup>min(m0,n0)</sup> \* 3<sup>min(m1,n1)</sup> \* 5<sup>min(m2,n2)</sup> \* ...
|
||||||
|
|
||||||
x 和 y 的最小公倍数为:lcm(x,y) = 2<sup>max(m0,n0)</sup> \* 3<sup>max(m1,n1)</sup> \* 5<sup>max(m2,n2)</sup> \* ...
|
x 和 y 的最小公倍数为:lcm(x,y) = 2<sup>max(m0,n0)</sup> \* 3<sup>max(m1,n1)</sup> \* 5<sup>max(m2,n2)</sup> \* ...
|
||||||
|
|
||||||
## 生成素数序列
|
## 1. 生成素数序列
|
||||||
|
|
||||||
[204. Count Primes (Easy)](https://leetcode.com/problems/count-primes/description/)
|
[204. Count Primes (Easy)](https://leetcode.com/problems/count-primes/description/)
|
||||||
|
|
||||||
|
@ -70,7 +68,7 @@ public int countPrimes(int n) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 最大公约数
|
## 2. 最大公约数
|
||||||
|
|
||||||
```java
|
```java
|
||||||
int gcd(int a, int b) {
|
int gcd(int a, int b) {
|
||||||
|
@ -86,7 +84,7 @@ int lcm(int a, int b) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用位操作和减法求解最大公约数
|
## 3. 使用位操作和减法求解最大公约数
|
||||||
|
|
||||||
[编程之美:2.7](#)
|
[编程之美:2.7](#)
|
||||||
|
|
||||||
|
@ -122,7 +120,7 @@ public int gcd(int a, int b) {
|
||||||
|
|
||||||
# 进制转换
|
# 进制转换
|
||||||
|
|
||||||
## 7 进制
|
## 1. 7 进制
|
||||||
|
|
||||||
[504. Base 7 (Easy)](https://leetcode.com/problems/base-7/description/)
|
[504. Base 7 (Easy)](https://leetcode.com/problems/base-7/description/)
|
||||||
|
|
||||||
|
@ -153,7 +151,7 @@ public String convertToBase7(int num) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 16 进制
|
## 2. 16 进制
|
||||||
|
|
||||||
[405. Convert a Number to Hexadecimal (Easy)](https://leetcode.com/problems/convert-a-number-to-hexadecimal/description/)
|
[405. Convert a Number to Hexadecimal (Easy)](https://leetcode.com/problems/convert-a-number-to-hexadecimal/description/)
|
||||||
|
|
||||||
|
@ -186,7 +184,7 @@ public String toHex(int num) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 26 进制
|
## 3. 26 进制
|
||||||
|
|
||||||
[168. Excel Sheet Column Title (Easy)](https://leetcode.com/problems/excel-sheet-column-title/description/)
|
[168. Excel Sheet Column Title (Easy)](https://leetcode.com/problems/excel-sheet-column-title/description/)
|
||||||
|
|
||||||
|
@ -214,7 +212,7 @@ public String convertToTitle(int n) {
|
||||||
|
|
||||||
# 阶乘
|
# 阶乘
|
||||||
|
|
||||||
## 统计阶乘尾部有多少个 0
|
## 1. 统计阶乘尾部有多少个 0
|
||||||
|
|
||||||
[172. Factorial Trailing Zeroes (Easy)](https://leetcode.com/problems/factorial-trailing-zeroes/description/)
|
[172. Factorial Trailing Zeroes (Easy)](https://leetcode.com/problems/factorial-trailing-zeroes/description/)
|
||||||
|
|
||||||
|
@ -232,7 +230,7 @@ public int trailingZeroes(int n) {
|
||||||
|
|
||||||
# 字符串加法减法
|
# 字符串加法减法
|
||||||
|
|
||||||
## 二进制加法
|
## 1. 二进制加法
|
||||||
|
|
||||||
[67. Add Binary (Easy)](https://leetcode.com/problems/add-binary/description/)
|
[67. Add Binary (Easy)](https://leetcode.com/problems/add-binary/description/)
|
||||||
|
|
||||||
|
@ -260,7 +258,7 @@ public String addBinary(String a, String b) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 字符串加法
|
## 2. 字符串加法
|
||||||
|
|
||||||
[415. Add Strings (Easy)](https://leetcode.com/problems/add-strings/description/)
|
[415. Add Strings (Easy)](https://leetcode.com/problems/add-strings/description/)
|
||||||
|
|
||||||
|
@ -282,7 +280,7 @@ public String addStrings(String num1, String num2) {
|
||||||
|
|
||||||
# 相遇问题
|
# 相遇问题
|
||||||
|
|
||||||
## 改变数组元素使所有的数组元素都相等
|
## 1. 改变数组元素使所有的数组元素都相等
|
||||||
|
|
||||||
[462. Minimum Moves to Equal Array Elements II (Medium)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/description/)
|
[462. Minimum Moves to Equal Array Elements II (Medium)](https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/description/)
|
||||||
|
|
||||||
|
@ -307,7 +305,7 @@ Only two moves are needed (remember each move increments or decrements one eleme
|
||||||
|
|
||||||
设数组长度为 N,则可以找到 N/2 对 a 和 b 的组合,使它们都移动到 m 的位置。
|
设数组长度为 N,则可以找到 N/2 对 a 和 b 的组合,使它们都移动到 m 的位置。
|
||||||
|
|
||||||
## 解法 1
|
**解法 1**
|
||||||
|
|
||||||
先排序,时间复杂度:O(NlogN)
|
先排序,时间复杂度:O(NlogN)
|
||||||
|
|
||||||
|
@ -325,7 +323,7 @@ public int minMoves2(int[] nums) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 解法 2
|
**解法 2**
|
||||||
|
|
||||||
使用快速选择找到中位数,时间复杂度 O(N)
|
使用快速选择找到中位数,时间复杂度 O(N)
|
||||||
|
|
||||||
|
@ -378,7 +376,7 @@ private void swap(int[] nums, int i, int j) {
|
||||||
|
|
||||||
# 多数投票问题
|
# 多数投票问题
|
||||||
|
|
||||||
## 数组中出现次数多于 n / 2 的元素
|
## 1. 数组中出现次数多于 n / 2 的元素
|
||||||
|
|
||||||
[169. Majority Element (Easy)](https://leetcode.com/problems/majority-element/description/)
|
[169. Majority Element (Easy)](https://leetcode.com/problems/majority-element/description/)
|
||||||
|
|
||||||
|
@ -406,7 +404,7 @@ public int majorityElement(int[] nums) {
|
||||||
|
|
||||||
# 其它
|
# 其它
|
||||||
|
|
||||||
## 平方数
|
## 1. 平方数
|
||||||
|
|
||||||
[367. Valid Perfect Square (Easy)](https://leetcode.com/problems/valid-perfect-square/description/)
|
[367. Valid Perfect Square (Easy)](https://leetcode.com/problems/valid-perfect-square/description/)
|
||||||
|
|
||||||
|
@ -432,7 +430,7 @@ public boolean isPerfectSquare(int num) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3 的 n 次方
|
## 2. 3 的 n 次方
|
||||||
|
|
||||||
[326. Power of Three (Easy)](https://leetcode.com/problems/power-of-three/description/)
|
[326. Power of Three (Easy)](https://leetcode.com/problems/power-of-three/description/)
|
||||||
|
|
||||||
|
@ -442,7 +440,7 @@ public boolean isPowerOfThree(int n) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 乘积数组
|
## 3. 乘积数组
|
||||||
|
|
||||||
[238. Product of Array Except Self (Medium)](https://leetcode.com/problems/product-of-array-except-self/description/)
|
[238. Product of Array Except Self (Medium)](https://leetcode.com/problems/product-of-array-except-self/description/)
|
||||||
|
|
||||||
|
@ -473,7 +471,7 @@ public int[] productExceptSelf(int[] nums) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 找出数组中的乘积最大的三个数
|
## 4. 找出数组中的乘积最大的三个数
|
||||||
|
|
||||||
[628. Maximum Product of Three Numbers (Easy)](https://leetcode.com/problems/maximum-product-of-three-numbers/description/)
|
[628. Maximum Product of Three Numbers (Easy)](https://leetcode.com/problems/maximum-product-of-three-numbers/description/)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user