Compare commits
No commits in common. "370417923863ee027de9165789135d4396b8e26b" and "907c7307acdacb5d6edb42b04dc210761afbb81a" have entirely different histories.
3704179238
...
907c7307ac
|
@ -1,4 +1,4 @@
|
||||||
pub fn part_1(input: &String) -> u64 {
|
pub fn part_1(input: &String) -> String {
|
||||||
let elves: Vec<&str> = input.split("\n\n").collect();
|
let elves: Vec<&str> = input.split("\n\n").collect();
|
||||||
|
|
||||||
let mut highest_calorie_count: u64 = 0;
|
let mut highest_calorie_count: u64 = 0;
|
||||||
|
@ -15,7 +15,7 @@ pub fn part_1(input: &String) -> u64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
highest_calorie_count
|
format!("{highest_calorie_count}")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn part_2(input: &String) -> u64 {
|
pub fn part_2(input: &String) -> u64 {
|
||||||
|
@ -28,5 +28,7 @@ pub fn part_2(input: &String) -> u64 {
|
||||||
let start = elf_calorie_counts.len() - 3;
|
let start = elf_calorie_counts.len() - 3;
|
||||||
let top_3 = elf_calorie_counts.drain(start..);
|
let top_3 = elf_calorie_counts.drain(start..);
|
||||||
|
|
||||||
|
println!("Top 3 elves: {:?}", top_3);
|
||||||
|
|
||||||
top_3.sum()
|
top_3.sum()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue