/** Solver for a problem: https://twitter.com/robertkaplinsky/status/1057037622995009543 */ a = array[1 to 9] smallest = 1e100 for c = a.combinations[6] { for p = c.permute[] { n1 = sqrt[p@0 * 100 + p@1 * 10 + p@2] n2 = sqrt[p@3 * 10 + p@4] n3 = sqrt[p@5] n = n1 - n2 - n3 if abs[n] <= smallest { println["$p\t$n"] smallest = abs[n] } } }