Pythagorean quadruples: Difference between revisions
m
→{{header|R}}: Syntax highlighting.
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
|||
Line 1,725:
=={{header|R}}==
The best solution to this problem - using lots of for loops - is practically language agnostic. The R way of doing this is far less efficient, taking about 10 minutes on my machine, but it's the obvious way to do this in R.
<lang
aAndb <- outer(squares, squares, '+')
aAndb <- aAndb[upper.tri(aAndb, diag = TRUE)]
|