reverse to make indices more readable
This commit is contained in:
parent
2b7b34eb1f
commit
f1001ef8ff
|
@ -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(())
|
||||
}
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue