The following is a visual problem I came across today. The question here is simply how many squares there are in the picture.
How would you go about solving something like this though code ? Furthermore, if the actual picture isn't processed, how would you go about modelling it ?
P.S: I sense that the actual resolution would require a rule to define what can be considered as a square. Something along the lines of saying that sides are equal in length and can be composed of any number of segments as long as they fit within the enclosing square. I'm not sure how you could represent a position though.