Systemverilog Function Return Dynamic Programming Leetcode