Source: Day 5: Cafeteria
Full solution for today (spoilers!).
Part 1
Given a list of ranges (inclusive) and a list of IDs, how many of the IDs are in any range?
Full solution for today (spoilers!).
Given a list of ranges (inclusive) and a list of IDs, how many of the IDs are in any range?
Full solution for today (spoilers!).
Given a list of numbers, for each find the two digits in the number which if concatenated make the largest. Sum these values.
For example:
811111111111119should be89.
Full solution for today (spoilers!).
Given a list of ranges
a-b(ie11-22), sum all values that are made of two repeated chunks of digits (ie123123)
I recently had a conversation about parsing HTTPS/TLS/etc certificates client side (so that various values could be compared). There are, of course, libraries for that, but where’s the fun in that? Let’s dig in ourselves!
I thought of course it would be a well specified format and it wouldn’t take more than a few minutes to parse… right?
Right?
Full solution for today (spoilers!).
Given a string containing (among other gibberish) commands of the form
mul({A}, {B})where{A}and{B}are integers, calculate the sum ofA*Bs.
Another Redis in Rust series. It’s really starting to come together now!
In this post, updating the state to store expiration times + a thread to handle said eviction + the implementation of a small pile more of the general Redis functions.
And I’m back. It’s been a busy month with the Genuary 2023 series and life in general, but I’m still thinking about Redis in general 😄.
Up this time, let’s see what the official redis-cli app does when talking to our client and actually start handling some commands. Specifically, the very basic commands: SET and GET. With that, we would actually have a (very very basic) keystore up and running!
Okay, we’ve got a server and we can ping it. Let’s actually make a simple client, so I don’t have to do funny things with echo any more. Specifically, let’s make a REPL!
Recently, I read through Build Your Own Redis with C/C++. C/C++ are ugly, so let’s run through it in Rust!
My goal: implement some large subset of Redis (both server and client) in Rust. For any features I implement, it should be compatible with Redis off the shelf. I should be able to use their client with my server and their server with my client and it should just work.
No idea if this is going to work out, but it sounds like an interesting problem!
First task: the REdis Serialization Protocol (RESP).
Given pairs of
Signals (where aSignalis a nested list ;example:[[1],[2,3,4]]), count how many pairs are ‘in order’.
One Signal is less than the other if: