File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ This Julia package contains my solutions for [Advent of Code 2024](https://adven
20
20
| 8 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/8 ) | 316.122 μs | 671.41 KiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day08.jl ) |
21
21
| 9 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/9 ) | 32.603 ms | 9.58 MiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day09.jl ) |
22
22
| 10 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/10 ) | 578.868 μs | 633.67 KiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day10.jl ) |
23
- | 11 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/11 ) | 16.464 ms | 13.70 MiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day11.jl ) |
23
+ | 11 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/11 ) | 15.732 ms | 12.60 MiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day11.jl ) |
24
24
| 12 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/12 ) | 12.506 ms | 10.00 MiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day12.jl ) |
25
25
| 13 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/13 ) | 3.423 ms | 1.15 MiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day13.jl ) |
26
26
| 14 | [ :white_check_mark : ] ( https://adventofcode.com/2024/day/14 ) | 75.842 ms | 275.06 KiB | [ :white_check_mark : ] ( https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day14.jl ) |
Original file line number Diff line number Diff line change @@ -48,9 +48,10 @@ function solve(data, runtime)
48
48
end
49
49
50
50
function split_number (number:: Int )
51
- n = length (digits (number))
52
- l = digits (number)[n÷ 2 + 1 : end ] .* [10 ^ x for x ∈ 0 : n÷ 2 - 1 ] |> sum
53
- r = digits (number)[1 : n÷ 2 ] .* [10 ^ x for x ∈ 0 : n÷ 2 - 1 ] |> sum
51
+ digs = digits (number)
52
+ n = length (digs)
53
+ l = @view (digs[n÷ 2 + 1 : end ]) .* [10 ^ x for x ∈ 0 : n÷ 2 - 1 ] |> sum
54
+ r = @view (digs[1 : n÷ 2 ]) .* [10 ^ x for x ∈ 0 : n÷ 2 - 1 ] |> sum
54
55
return l, r
55
56
end
56
57
You can’t perform that action at this time.
0 commit comments