Update worst_best_time_complexity,

leetcode_two_sum
This commit is contained in:
Yudong Jin
2023-02-03 18:53:15 +08:00
parent 592965595e
commit 70dead5cd0
24 changed files with 63 additions and 121 deletions

View File

@@ -5,6 +5,7 @@
const std = @import("std");
const inc = @import("include");
// 方法一:暴力枚举
const SolutionBruteForce = struct {
pub fn twoSum(self: *SolutionBruteForce, nums: []i32, target: i32) [2]i32 {
_ = self;
@@ -23,6 +24,7 @@ const SolutionBruteForce = struct {
}
};
// 方法二:辅助哈希表
const SolutionHashMap = struct {
pub fn twoSum(self: *SolutionHashMap, nums: []i32, target: i32) ![2]i32 {
_ = self;