Example 5. Draw a straight line on an $n \times n$ chessboard. What is the maximum number of squares this line can pass through?
Solution: First, we examine the case of a $3 \times 3$ grid to design the "best line" (i.e., the line that passes through the most cells).

As shown in Figure 5, it is clear that $l_{3}$ is the "best line," characterized by the two indices of the cells $a_{ij}$ it passes through alternating and increasing. Thus, 
the "best line" in an $n \times n$ grid passes through the cells in the sequence $a_{11}$, $a_{21}$, $a_{22}$, $a_{32}$, $\cdots$, $a_{n, n-1}$, $a_{n n}$, covering $n$ even cells $a_{11}$, $a_{22}$, $\cdots$, $a_{nn}$, and passing through one odd cell between each pair of adjacent even cells, totaling $n-1$ odd cells. Therefore, the maximum number of cells the line passes through is: $n + (n-1) = 2n-1$.