/** 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[] { n = sqrt[p@0*100 + p@1*10 + p@2] - sqrt[p@3*10 + p@4] - sqrt[p@5] if abs[n] <= smallest { println["$p\t$n"] smallest = abs[n] } }