solved 76 with a bottom up dp approach