Guys, need help for this problem https://www.hackerrank.com/challenges/lego-blocks
How can I formulate DP for this problem