Day 15, small cleanup
This commit is contained in:
parent
e9e7478fe2
commit
ce55569030
1 changed files with 1 additions and 2 deletions
|
@ -49,8 +49,7 @@ fn get_number(start: &[usize], num_turns: usize) -> usize {
|
|||
let mut nums = start.to_vec();
|
||||
let mut num=std::usize::MAX;
|
||||
for i in 1..num_turns {
|
||||
let e = cache.entry(nums[i - 1]).or_default();
|
||||
num=e.add(i);
|
||||
num = cache.entry(nums[i - 1]).or_default().add(i);
|
||||
if i >= nums.len() {
|
||||
nums.push(num);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue