reverse to make indices more readable

main
Christian Ulrich 2022-12-12 02:41:56 +01:00
parent 2b7b34eb1f
commit f1001ef8ff
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
2 changed files with 4 additions and 8 deletions

View File

@ -28,9 +28,7 @@ fn main() -> Result<(), &'static str> {
.map(Monkey::item_count)
.collect();
item_counts.sort();
println!(
"{}",
item_counts[item_counts.len() - 1] * item_counts[item_counts.len() - 2]
);
item_counts.reverse();
println!("{}", item_counts[0] * item_counts[1]);
Ok(())
}

View File

@ -28,9 +28,7 @@ fn main() -> Result<(), &'static str> {
.map(Monkey::item_count)
.collect();
item_counts.sort();
println!(
"{}",
item_counts[item_counts.len() - 1] * item_counts[item_counts.len() - 2]
);
item_counts.reverse();
println!("{}", item_counts[0] * item_counts[1]);
Ok(())
}