Skip to content

Commit

Permalink
2023-08-27 v. 2.1.0: updated "27. Remove Element"
Browse files Browse the repository at this point in the history
  • Loading branch information
fartem committed Aug 27, 2023
1 parent b3a22d7 commit 3446655
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion leetcode-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 'English'
::Gem::Specification.new do |s|
s.required_ruby_version = '>= 3.0'
s.name = 'leetcode-ruby'
s.version = '2.0.9'
s.version = '2.1.0'
s.license = 'MIT'
s.files = ::Dir['lib/**/*.rb'] + %w[bin/leetcode-ruby README.md LICENSE]
s.executable = 'leetcode-ruby'
Expand Down
2 changes: 1 addition & 1 deletion lib/easy/27_remove_element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# @return {Integer}
def remove_element(nums, val)
result = -1
(0..nums.length).step(1) do |i|
(0..nums.length).each do |i|
nums[result += 1] = nums[i] if nums[i] != val
end

Expand Down

0 comments on commit 3446655

Please sign in to comment.