Square Triple

February 14, 2020

We have a simple homework problem today:

Given a list of distinct integers, find all triples (x y z) where x, y and z are in the list and x * y = z².

Your task is to find the list of triples. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.

Advertisement

Pages: 1 2