You can
put this solution on YOUR website!50 = c + m + s
where c = chocochip, m = M&M and s = sugar.
Let's get everything in terms of one of the cookies to simplify.
Sugar cookies twice as many as chocochip:
Two more M&M than chocochip:
Now express total just in terms of chocochips cookies:

Simplify :
Now we know there were 12 chocochip. Plug in this number to find the others.

Sugar cookies

M&M cookies
Check your work by adding them all up:
24 + 14 + 12 = 50