Mines HSPC 2020: Problem K: Snails Solution and Explanation
Channel: Sumner Evans
Date: 02/05/2020

In this video, I solve and explain the "Snails" problem, which was Problem K of the Mines 2020 High School Programming Competition hosted on April 25, 2020. https://mines20.kattis.com/problems/mines20.snails

As I'm solving the problem, I try and provide as much commentary into my thought process and general-solving techniques. I hope that you can gain some insight into how someone with some experience in competitive programming and who currently makes a living as a software engineer might approach this problem.

Here are some timestamps of interesting points in the video:
00:00 - Introduction
01:16 - Why the input constraints make this problem difficult.
03:10 - Explanation of one method of making the algorithm efficient enough.
04:29 - Implementing the recursive version of the sequence.
05:51 - Loop through the input and compare it against the sequence.
08:57 - Applying memoization to the recursive function.
10:13 - I discuss the general memoization technique and how to apply it.

And yes, I've sped up the typing in a few places. I'm not that fast :)
Sorry for the slightly out-of-sync audio and video, still trying to learn!