To find the number of office buildings Liam cleaned, let \( x \) be the number of office buildings. Since he cleaned 21 windows per office building, the total number of windows cleaned from the office buildings is \( 21x \). He also cleaned 42 windows from a school. Therefore, the total number of windows cleaned can be expressed as:
\[ 21x + 42 = 126 \]
Thus, the equation that could be used to solve this problem algebraically is:
21x + 42 = 126