I really have no idea how to do this using dynamic programming: Problem: I need to find the 2 largest non overlapping squares of a table For example:
5 6
R F F R R F
F F F F F F
R R F F F F
F F F F F F
F F F F F F
The numbers 5 and 6 are the number of rows and columns respectively, and “R” means reserved and “F” means free. In this case the largest square is
F F F F
F F F F
F F F F
F F F F
and the second largest (non-overlapping with the previous one) is
F F
F F
So far I have put the values into a 2D array, but do not know what to do after. Tried to reference 0-1 knapsack and LCS, but really I have no clue on what values I should put into my table.