Anonymous user
Collect and sort square numbers in ascending order from three lists: Difference between revisions
Collect and sort square numbers in ascending order from three lists (view source)
Revision as of 00:58, 25 August 2023
, 9 months agono edit summary
(Created Nim solution.) |
imported>Maxima enthusiast No edit summary |
||
Line 340:
{{out}}<pre>
{4,9,16,25,36,36,49,81,121,144,169}
</pre>
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
list[1]: [3,4,34,25,9,12,36,56,36]$
list[2]: [2,8,81,169,34,55,76,49,7]$
list[3]: [75,121,75,144,35,16,46,35]$
block(makelist(sublist(list[i],lambda([x],integerp(sqrt(x)))),i,1,3),map(sort,%%));
</syntaxhighlight>
{{out}}<pre>
[[4,9,25,36,36],[49,81,169],[16,121,144]]
</pre>
|