David Betteridge's Avatar

David Betteridge

@davidbetteridge.net.bsky.social

c# developer, ultra runner.

25 Followers  |  27 Following  |  6 Posts  |  Joined: 22.11.2024  |  1.559

Latest posts by davidbetteridge.net on Bluesky

Do you want the name of an algorithm to research?

16.12.2024 17:16 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It was fun trying to speed up Part 2 of Day 6. I'm down to about 57ms (in c#) but stuck for ideas for now...!

#AdventOfCode. #csharp

06.12.2024 18:05 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

A friend of mine's Rust solution is here:
github.com/cmaughan/aoc...
This sort of thing

let mut tokens = Vec::new();
while self.position < self.input.len() {
let c = self.input[self.position..].chars().next().unwrap();
if c.is_whitespace() {
self.position += c.len_utf8();

04.12.2024 14:04 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

what language are you using?

I would keep track of the state you are in.
Start in state=0,
Parse mul( and you are now in state 1
If you see a number, and you are in state 1 then ....

04.12.2024 13:50 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Day 3

I like the speed of the GeneratedRegex source code generators in .net :-)

Part1: 130.9 us. (502.72 KB)
Part2: 125.5 us. (476.02 KB)

#AdventOfCode

03.12.2024 12:09 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0



I was pleased to be able to use C#'s SearchValues and SplitAny functions in Day 1 of Advent of Code.

:-)

#AdventOfCode

01.12.2024 11:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@davidbetteridge.net is following 20 prominent accounts