My first question is: How would one solve such problems (in general,squares+rectangles). What should be the general technique?How can this problem be reduced to a mathematical problem?
My second question is: When to be sure that we have counted all the squares in such problems?