dtl wrote:Is there any quick method to approach this question instead of testing cases?
there's no other method.
on the other hand, your question suggests that you consider testing cases "slow" -- which means that your approach probably lacks
organization. if your testing of cases is properly organized, it should be quite fast.
as just one example, you could organize the cases according to the single biggest possible number, and work your way down.
* 9^2 is more than 75, so the biggest possible single number is 8.
* if one of the numbers is 8, then 8^2 = 64. that leaves 75 - 64 = 11 for the other two numbers.
there are no two integers whose squares add up to 11 (a fact you can figure out in about five seconds), so 8 can't be one of the numbers.
* if one of the numbers is 7, then 7^2 = 49, leaving 75 - 49 = 26 for the other two numbers.
you can make 26 = 5^2 + 1^2.
so, your numbers are 7, 5, and 1.
fast and painless.
Ron has been teaching various standardized tests for 20 years.
--
Pueden hacerle preguntas a Ron en castellano
Potete chiedere domande a Ron in italiano
On peut poser des questions à Ron en français
Voit esittää kysymyksiä Ron:lle myös suomeksi
--
Quand on se sent bien dans un vêtement, tout peut arriver. Un bon vêtement, c'est un passeport pour le bonheur.
Yves Saint-Laurent
--
Learn more about ron