Yes there are two valid answers to the quadratic (10 and -9). This is where you have to apply common sense. Clearly the idea of -9 sweets is silly. The question stated there were sweets in the bag.I'm not sure youngsters' minds can cope with the idea of -9 sweets.
Apply Trog's "logic", 18 yellow sweets + 6 orange ones. Therefore n=24. n²-n-90≠0. Oh dear!