Compare commits
1 Commits
10e760c49d
...
bc8de05d69
| Author | SHA1 | Date | |
|---|---|---|---|
| bc8de05d69 |
@ -45,8 +45,6 @@ fn parse(input: &str) -> Vec<u32> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Finds pairs of numbers in `nums` that sum to 2020. If no pairs are found, the function panics.
|
/// Finds pairs of numbers in `nums` that sum to 2020. If no pairs are found, the function panics.
|
||||||
/// TODO(wathiede): make a version that sorts or uses a hash for finding the match to compare
|
|
||||||
/// benchmarks.
|
|
||||||
#[aoc(day1, part1, linear)]
|
#[aoc(day1, part1, linear)]
|
||||||
fn find_pair_2020_linear(nums: &[u32]) -> u32 {
|
fn find_pair_2020_linear(nums: &[u32]) -> u32 {
|
||||||
for (idx, first) in nums.iter().enumerate() {
|
for (idx, first) in nums.iter().enumerate() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user