Synopsys Interview Question

About dynamic programming and stack.