The ruling party, recently reelected in a fraudulent election has declared that EU accession talks will be stopped until 2028. This has stoked ongoing protests over election results.
Gobbel2000
Rust
Right IDs are directly read into a hash map counter.
use std::str::FromStr;
use std::collections::HashMap;
fn part1(input: String) {
let mut left = Vec::new();
let mut right = Vec::new();
for line in input.lines() {
let mut parts = line.split_whitespace()
.map(|p| u32::from_str(p).unwrap());
left.push(parts.next().unwrap());
right.push(parts.next().unwrap());
}
left.sort_unstable();
right.sort_unstable();
let diff: u32 = left.iter().zip(right)
.map(|(l, r)| l.abs_diff(r))
.sum();
println!("{diff}");
}
fn part2(input: String) {
let mut left = Vec::new();
let mut right: HashMap<u32, u32> = HashMap::new();
for line in input.lines() {
let mut parts = line.split_whitespace()
.map(|p| u32::from_str(p).unwrap());
left.push(parts.next().unwrap());
*right.entry(parts.next().unwrap()).or_default() += 1;
}
let similar: u32 = left.iter()
.map(|n| n * right.get(n).copied().unwrap_or_default())
.sum();
println!("{similar}");
}
util::aoc_main!();
I actually agree that I enjoyed playing the first more than the second. In the second, the story just didn't feel very gripping, progression was slow and gameplay ended up quite complicated with weird mechanics. But in the first game, the atmosphere, story and more distraction-free gameplay made up for the overall age of the game.
Supported!
I have been really happy with sway. It does all that I want it to do.
Is it a requirement for journalists now to not understand how the unit Watts works in relation to time?
While I can agree with most of this map, you have absolutely no right to include South Tyrolia in this, they value their food a lot and don't lack behind the rest of Italy at all.
What bias is it if the only entry I've read in this table is the one for confirmation bias?
That P != NP.
I can already do that on LineageOS 21 (Android 14), no rooting required.
Debugging CI pipelines is so annoying, why is there no better way than committing a bunch of dumb changes until it works?
Rust
The function is_sorted_by on Iterators turned out helpful for compactly finding if a report is safe. In part 2 I simply tried the same with each element removed, since all reports are very short.