OK...let's call the number of boxes he bought holding 7 cards, x. And let's call the number of boxes he bought holding 9 cards, y.
So we have
x + y = 17 (A)
And , the number of cards in each box type, times the number it holds added together = 135
So we have
7x + 9y = 135 and
x + y = 17 By multiplying the bottom equation on both sides by -7, we can "eliminate" x. So we have
7x + 9y = 135
-7x - 7y = -119 And we get
2y = 16 So
y = 8 And substituting this into (A), we have
x + 8 = 17
So x = 9
So he bought 9 boxes of 7 cards and 8 boxes of 9 cards = 135 cards