Remove duplicate elements: Difference between revisions
Content added Content deleted
(Add Ecstasy example) |
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag) |
||
Line 2,146: | Line 2,146: | ||
=={{header|Ecstasy}}== |
=={{header|Ecstasy}}== |
||
<syntaxhighlight lang="java"> |
<syntaxhighlight lang="java"> |
||
module RetainUniqueValues |
|||
{ |
{ |
||
@Inject Console console; |
@Inject Console console; |
||
Line 2,153: | Line 2,154: | ||
Int[] array = [1, 2, 3, 2, 1, 2, 3, 4, 5, 3, 2, 1]; |
Int[] array = [1, 2, 3, 2, 1, 2, 3, 4, 5, 3, 2, 1]; |
||
array = array.distinct().toArray(); |
array = array.distinct().toArray(); |
||
console. |
console.print($"result={array}"); |
||
} |
} |
||
} |
} |
||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
result=[1, 2, 3, 4, 5] |
|||
</pre> |
|||
=={{header|Elixir}}== |
=={{header|Elixir}}== |