MCPcopy Create free account
hub / github.com/LjyYano/LeetCode / twoSum

Method twoSum

src/main/java/L0001_TwoSum.java:21–41  ·  view source on GitHub ↗

使用哈希表存储遍历过的数字及其索引,实现 O(n) 的时间复杂度 @param nums 输入数组 @param target 目标值 @return 满足条件的下标数组 @throws IllegalArgumentException 无解时抛出异常

(int[] nums, int target)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

mainMethod · 0.95

Calls 2

getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected