3 ms·
Heh I wondered the same thing, but the README says he may not complete every challenge. I actually did the first problem in SQL, and learned a bit about window
by jsmeaton 5y ago
Heh I wondered the same thing, but the README says he may not complete every challenge. I actually did the first problem in SQL, and learned a bit about window functions and bounding the range it covers:
https://github.com/jarshwah/advent-of-code/blob/main/sql/2021/q01.py#L21 https://github.com/jarshwah/advent-of-code/blob/main/sql/202...
Though now I know you can ignore the window and just compare against the 3rd offset, the first solution just needs a `LEAD(depth, 3)` to complete the second question.
Still - I learned about `RANGE BETWEEN` so I'm calling it a win.