Tiles problem-II recursion


this code failed all test cases TLE

Try to solve this problem in bottom up approach.