triangle minimum path with bottom-up DP