Skip to content

Commit

Permalink
Added information in ruby file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChandanChainani committed Oct 7, 2022
1 parent a6656e9 commit 8d1ee8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/fixtures/code_samples/main.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Segregate 0s on left side and 1s on right side in given array
def segregate(a)
left, right = 0, a.length - 1
while left < right
Expand All @@ -18,7 +19,9 @@ def segregate(a)
right -= 1
end
end

return a
end

p segregate([1,0,1,1,0,0]) # => [0, 0, 0, 1, 1, 1]
p segregate([1,0,1,1,0,0])
# Output: [0, 0, 0, 1, 1, 1]

0 comments on commit 8d1ee8d

Please sign in to comment.