Tweak day 1 code structure
This commit is contained in:
parent
859699bcd0
commit
794cc70d60
|
@ -5,12 +5,13 @@ pub fn main() anyerror!void {
|
|||
defer arena.deinit();
|
||||
const alloc = &arena.allocator;
|
||||
|
||||
// Part 1
|
||||
// Read our input
|
||||
var f = try std.fs.cwd().openFile("input", .{});
|
||||
defer f.close();
|
||||
var contents = try f.readToEndAlloc(alloc, std.math.maxInt(u32));
|
||||
defer alloc.free(contents);
|
||||
|
||||
// Part 1
|
||||
var depths = std.ArrayList(u32).init(alloc);
|
||||
defer depths.deinit();
|
||||
|
||||
|
|
Reference in New Issue