title: Maximum possible number of rectangles that can be crossed with a single straight line
body: <p>I found this challenge problem which states the following :</p>
  
  <blockquote>
    <p>Suppose that there are n rectangles on the XY plane. Write a program to calculate the maximum possible number of rectangles that can be crossed with a single straight line drawn on this plane.</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/ulPm8.png" alt="see image for an example"></p>
  
  <p>I have been brainstorming for quite a time but couldn't find any solution.
  Maybe at some stage, we use dynamic programming steps but couldn't figure out how to start.</p>