mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-27 19:58:06 +01:00
add tests
This commit is contained in:
parent
9576b18a61
commit
74645b3e8f
1 changed files with 5 additions and 0 deletions
|
@ -78,6 +78,11 @@ def remove_element(nums, val)
|
||||||
pointer1
|
pointer1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts remove_elements([3,2,2,3], 3)
|
||||||
|
# => 2
|
||||||
|
puts remove_elements([0,1,2,2,3,0,4,2], 2)
|
||||||
|
# => 5
|
||||||
|
|
||||||
#
|
#
|
||||||
# Approach 4: Two-pointers (Optimized)
|
# Approach 4: Two-pointers (Optimized)
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue