Skip to content

Commit

Permalink
2023-08-27 v. 2.1.4: updated "338. Counting Bits"
Browse files Browse the repository at this point in the history
  • Loading branch information
fartem committed Aug 27, 2023
1 parent 52b299e commit 798757d
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.1.2'
s.version = '2.1.4'
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/338_counting_bits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @return {Integer[]}
def count_bits(n)
result = []
(0..n).step(1) do |i|
(0..n).step do |i|
count = 0
count += i & 1 and i >>= 1 until i.zero?
result << count
Expand Down

0 comments on commit 798757d

Please sign in to comment.