Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -0,0 +1,15 @@
|
|||
def unique(array)
|
||||
pure = Array.new
|
||||
for i in array
|
||||
flag = false
|
||||
for j in pure
|
||||
flag = true if j==i
|
||||
end
|
||||
pure << i unless flag
|
||||
end
|
||||
return pure
|
||||
end
|
||||
|
||||
|
||||
unique ["hi","hey","hello","hi","hey","heyo"] # => ["hi", "hey", "hello", "heyo"]
|
||||
unique [1,2,3,4,1,2,3,5,1,2,3,4,5] # => [1,2,3,4,5]
|
||||
Loading…
Add table
Add a link
Reference in a new issue