TPRUTETYQBXMJVMGSTO573TGCXWXQA4642VSPLRBTJ6YN5UVMZ2QC
SPON6U5RKD4XUHNHLXYUQ2IVY7VGQZT4U4MHDHH7BJBMLW42CZGAC
NNEOPQV6SNXJVL3UOUR45I4PLDL5IV72FE4GAQPJSHHRXGFL6QTAC
DEBJKGU2F4MD5O3DMLE3XPKOGJOAG2KZHMQX7DP52RAP4HBKGFSQC
NBWIQLPZIFZRXGCDMIFXQAAWWVQEOJDP6KIALLI2NJE4YSNCCNOAC
std.debug.print("Day 4 \tfirst part result: {d} \ttime: {d}µs\t", .{ ret, f });
std.debug.print("Day 4 \tfirst part result: {d} \ttime: {d}µs\n", .{ ret, f });
const retSize = u24;const lineSize = getLineSize();
const retSize = u24;
const lineSize = getLineSize();
const RetType = u24;const line_size = getLineSize();
const RetType = u24;
const line_size = getLineSize();
pub fn first() anyerror!retSize {
pub fn first() anyerror!RetType {
var ones: [lineSize]retSize = undefined; var zeros: [lineSize]retSize = undefined;
var ones: [lineSize]retSize = undefined;
var zeros: [lineSize]retSize = undefined;
var ones = [_]u10{0} ** line_size; var zeros = [_]u10{0} ** line_size;
var ones = [_]u10{0} ** line_size;
var zeros = [_]u10{0} ** line_size;
var gammaRate: [lineSize]u8 = undefined; var epsilonRate: [lineSize]u8 = undefined;
var gammaRate: [lineSize]u8 = undefined;
var epsilonRate: [lineSize]u8 = undefined;
var gammaRate: [line_size]u8 = undefined; var epsilonRate: [line_size]u8 = undefined;
var gammaRate: [line_size]u8 = undefined;
var epsilonRate: [line_size]u8 = undefined;
const gr = try std.fmt.parseUnsigned(retSize, &gammaRate, 2); const er = try std.fmt.parseUnsigned(retSize, &epsilonRate, 2);
const gr = try std.fmt.parseUnsigned(retSize, &gammaRate, 2);
const er = try std.fmt.parseUnsigned(retSize, &epsilonRate, 2);
const gr = try std.fmt.parseUnsigned(RetType, &gammaRate, 2); const er = try std.fmt.parseUnsigned(RetType, &epsilonRate, 2);
const gr = try std.fmt.parseUnsigned(RetType, &gammaRate, 2);
const er = try std.fmt.parseUnsigned(RetType, &epsilonRate, 2);
try std.testing.expectEqual(ret, @as(retSize, 3847100));
try std.testing.expectEqual(@as(RetType, 3847100), ret);
try std.testing.expectEqual(@as(retSize, 3847100), try first());
try std.testing.expectEqual(@as(RetType, 3847100), try first());