Skip to content

Commit 7703e08

Browse files
committed
[Day 1] Slight improvement
1 parent f450402 commit 7703e08

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This Julia package contains my solutions for [Advent of Code 2024](https://adven
1010

1111
| Day | Problem | Time | Allocated memory | Source |
1212
|----:|:-------:|-----:|-----------------:|:------:|
13-
| 1 | [:white_check_mark:](https://adventofcode.com/2024/day/1) | 482.120 μs | 584.44 KiB | [:white_check_mark:](https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day01.jl) |
13+
| 1 | [:white_check_mark:](https://adventofcode.com/2024/day/1) | 459.477 μs | 461.83 KiB | [:white_check_mark:](https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day01.jl) |
1414
| 2 | [:white_check_mark:](https://adventofcode.com/2024/day/2) | 2.070 ms | 3.64 MiB | [:white_check_mark:](https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day02.jl) |
1515
| 3 | [:white_check_mark:](https://adventofcode.com/2024/day/3) | 470.249 μs | 376.73 KiB | [:white_check_mark:](https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day03.jl) |
1616
| 4 | [:white_check_mark:](https://adventofcode.com/2024/day/4) | 1.798 ms | 3.06 MiB | [:white_check_mark:](https://github.com/goggle/AdventOfCode2024.jl/blob/main/src/day04.jl) |

src/day01.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using AdventOfCode2024
44

55

66
function day01(input::String = readInput(joinpath(@__DIR__, "..", "data", "day01.txt")))
7-
data = [parse.(Int, x) for x split(rstrip(input))]
7+
data = [parse.(Int, x) for x eachsplit(rstrip(input))]
88
left = data[1:2:end]
99
right = data[2:2:end]
1010
p1 = abs.(sort(left) - sort(right)) |> sum

0 commit comments

Comments
 (0)