Fork me on GitHub

Having a list of integers how would I find the biggest square area that can fit in the columns? With clojure.logic or preferrably with I couldn’t find an example or a tutorial that help me with this kind of problem. Examples:

1234321     321     423

   0                0
  ***       0       0 0
 0***0      **      **0
00***00     **0     **0
= 3         = 2     = 2


it seems like the kind of think you might be able to find a formula for


I think with logic programming or some kind of sat solver you are going to have trouble, because both of those tend to be good answering "does a solution to this exist" and less so at solving "find me the solution with property x"


actually, I think you can put that in terms of does X exist: "Does X exist where X is a number that fits in row 0, and row 0 + X, and X+1 doesn't fit in row 0 + X + 1"


the biggest result or smallest result, is a constraint relative to all the other answers, which means you have to compute all the other possible answers


Ok, I think that helps. I’ll ponder on it. Thanks!