Sum multiples of 3 and 5: Difference between revisions
→{{header|Uiua}}: Alternative solution.
(Added UIUA) |
(→{{header|Uiua}}: Alternative solution.) |
||
(One intermediate revision by one other user not shown) | |||
Line 4,889:
Completed in 4 seconds.
=={{header|
<syntaxhighlight>
End ← 1000
Line 4,898:
IndicesFive ← MultOffive ↘1⇡End
/+
</syntaxhighlight>
{{out}}
Line 4,904:
</pre>
Alternatively, leaving the 0th element in place means index of n == n, so a simpler solution would be:
<syntaxhighlight>
End ← 1000
MultOf ← ⊚=0◿
/+◴⊂⊃(MultOf3)(MultOf5)⇡End
</syntaxhighlight>
=={{header|UNIX Shell}}==
|