https://mysteryweevil.medium.com/mastering-python-dynamic-programming-a-practical-guide-for-beginners-a5260784ff7a