Remove duplicate elements: Difference between revisions
Content added Content deleted
Line 2,147: | Line 2,147: | ||
=={{header|Ecstasy}}== |
=={{header|Ecstasy}}== |
||
<syntaxhighlight lang="java"> |
<syntaxhighlight lang="java"> |
||
module RetainUniqueValues |
module RetainUniqueValues { |
||
{ |
void run() { |
||
⚫ | |||
void run() |
|||
{ |
|||
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.print($"result={array}"); |
console.print($"result={array}"); |
||
} |
|||
} |
} |
||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||