Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -0,0 +1,17 @@
|
|||
begin
|
||||
// By algorithm
|
||||
var nums := Arr(1, 1, 2, 3, 4, 4);
|
||||
var unique := new List<integer>;
|
||||
foreach var x in nums do
|
||||
if x not in unique then
|
||||
unique.Add(x);
|
||||
unique.Println;
|
||||
|
||||
// By method
|
||||
var unique2 := nums.Distinct;
|
||||
unique2.Println;
|
||||
|
||||
// Using hash set
|
||||
var unique3 := HSet(nums);
|
||||
unique3.Println;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue