MCPcopy Index your code
hub / github.com/TheAlgorithms/Rust / two_sum

Function two_sum

src/general/two_sum.rs:18–45  ·  view source on GitHub ↗

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. # Parameters - `nums`: A list of numbers to check. - `target`: The target sum. # Returns If the target sum is found in the array, the indices of the augend and addend are returned as a tuple. If the target sum cannot be found in the array, `None` is returned.

(nums: Vec<i32>, target: i32)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 3

iterMethod · 0.45
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected