review dynamic program problem triangle