This commit is contained in:
krahets
2023-02-07 17:17:14 +08:00
parent ecbf2d1560
commit 1ca5c731f7
19 changed files with 501 additions and 192 deletions

View File

@@ -33,6 +33,7 @@ comments: true
=== "Java"
```java title="leetcode_two_sum.java"
/* 方法一:暴力枚举 */
class SolutionBruteForce {
public int[] twoSum(int[] nums, int target) {
int size = nums.length;
@@ -207,6 +208,7 @@ comments: true
=== "Java"
```java title="leetcode_two_sum.java"
/* 方法二:辅助哈希表 */
class SolutionHashMap {
public int[] twoSum(int[] nums, int target) {
int size = nums.length;