From 7b47337e40672c4c5f12a2773d3888c17237f36a Mon Sep 17 00:00:00 2001 From: Xander Bil Date: Wed, 4 Dec 2024 23:58:20 +0100 Subject: solutions day3 and 4 --- src/day01.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/day01.zig') diff --git a/src/day01.zig b/src/day01.zig index 33b0a67..d92e756 100644 --- a/src/day01.zig +++ b/src/day01.zig @@ -8,7 +8,7 @@ pub fn solve(part: []u8, buffer: []u8, allocator: std.mem.Allocator) !void { defer left.deinit(); defer right.deinit(); - if (std.mem.eql(u8, part, "part1")) { + if (std.mem.eql(u8, part, "1")) { try part1(&lines, &left, &right, allocator); } else { try part2(&lines, &left, &right, allocator); @@ -41,7 +41,7 @@ fn part1(lines: *std.mem.SplitIterator(u8, .scalar), left: *std.ArrayList(usize) } } - print("Sum is {d}\n", .{sum}); + print("{d}\n", .{sum}); } fn part2(lines: *std.mem.SplitIterator(u8, .scalar), left: *std.ArrayList(usize), right: *std.ArrayList(usize), allocator: std.mem.Allocator) !void { @@ -77,5 +77,5 @@ fn part2(lines: *std.mem.SplitIterator(u8, .scalar), left: *std.ArrayList(usize) }; } - print("Sum is {d}\n", .{sum}); + print("{d}\n", .{sum}); } -- cgit v1.2.3