Nice solution. Just a little Rust tip if you don't mind: In this case you can avoid cloning the input Vec in the loops by instead looping over references into the list with for n in self.input.iter() or simpler for n in &self.input. The only difference is that n will be of type &i64 instead of i64.
Gobbel2000
Rust
Almost missed, that "the dial starts by pointing at 50".
const N: i32 = 100;
fn parse_line(l: &str) -> (i32, i32) {
let dir = match l.chars().next().unwrap() {
'L' => -1,
'R' => 1,
_ => panic!(),
};
let dist = l[1..].parse::<i32>().unwrap();
(dir, dist)
}
fn part1(input: String) {
let mut pos = 50;
let mut count0 = 0;
for l in input.lines() {
let (dir, dist) = parse_line(l);
pos = (pos + dir * dist) % N;
if pos == 0 {
count0 += 1;
}
}
println!("{count0}");
}
fn part2(input: String) {
let mut pos = 50;
let mut count0 = 0;
for l in input.lines() {
let (dir, dist) = parse_line(l);
if dir == 1 {
count0 += (pos + dist) / N;
} else {
count0 += ((N - pos) % N + dist) / N;
}
pos = (pos + dir * dist).rem_euclid(N);
}
println!("{count0}");
}
util::aoc_main!();
The practical answer is: you drive as far as you legally can.
As a disclaimer, pictured here are the Himalayas, which are at a completely different scale to where I've been, but in my experience there are typically parking spaces/bus stops at the end of public roads. At this point you leave the built up infrastructure and enter nature, and these are often located in a place where the flatter valley ends and a steeper ascent begins. In many cases there are smaller private roads further up to service more remote cabins or farmsteads. Sometimes there are even taxi services that drive you further along using private roads, which can be seen as not fully scaling the mountain yourself. Generally, the closest public parking is considered the starting point and most people will therefore start at the same spot.
To be fair, nowadays the Linux kernel does rely quite a bit on resources from major software (and hardware) companies.
Russians already far ahead:

Wait, it's not pronounced pffned?
GeneralsekretΓ€rin?
This is actually an air defence drone in action.
All offices within the EU administration will be supplied with the officially modified flavors of eumacs and neuvim.
Gustav Holst, Neptune (from The Planets). Really strikingly captures the sense of the outer edges of our solar system, even if it's not the whole world.
Did an oopsie. I never realized that after upgrading the OS, my certbot renew service to renew the HTTPS certificate always failed. So now I had an expired certificate. At least it was an easy fix by reinstalling certbot.
Rust
View on github
I feared that this required some complicated maths to quickly figure out the next "invalid" number, but the total number of IDs to check was only about 2 million, so brute force it is.