This is a lovely youtube video exploring code optimizations by cleverly pruning the state space in a Code of Advent problem; it has a lot of good generic advice, and quite a funny ending.