Let's assume the number of cookies Lily bought is represented by "C," and the number of brownies is represented by "B."
According to the problem, the cost of one cookie is $2, and the cost of one brownie is $3. Lily spent a total of $144.
We can set up two equations based on the given information:
C + B = 60 (equation 1, representing the total number of sweets)
2C + 3B = 144 (equation 2, representing the total cost in dollars)
To solve this system of equations, we can use substitution or elimination method. Here, we'll use the substitution method.
From equation 1, we can rewrite it as C = 60 - B.
Now substitute this value of C in equation 2:
2(60 - B) + 3B = 144
Simplify the equation:
120 - 2B + 3B = 144
Combine like terms:
120 + B = 144
Subtract 120 from both sides:
B = 144 - 120
B = 24
Now substitute the value of B back into equation 1 to find C:
C + 24 = 60
C = 60 - 24
C = 36
Therefore, Lily bought 36 cookies and 24 brownies.