https://medium.com/gateway-to-thoughts/approaches-to-problem-solving-applying-dynamic-programming-on-2-d-matrices-a765892596e3