Skip to content

Commit ef478eb

Browse files
authored
Merge pull request #309 from fartem/868_Binary_Gap-update
2023-08-29 v. 2.5.2: updated "868. Binary Gap"
2 parents e409a0c + 767fcc3 commit ef478eb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

leetcode-ruby.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require 'English'
55
::Gem::Specification.new do |s|
66
s.required_ruby_version = '>= 3.0'
77
s.name = 'leetcode-ruby'
8-
s.version = '2.5.1'
8+
s.version = '2.5.2'
99
s.license = 'MIT'
1010
s.files = ::Dir['lib/**/*.rb'] + %w[bin/leetcode-ruby README.md LICENSE]
1111
s.executable = 'leetcode-ruby'

lib/easy/868_binary_gap.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def binary_gap(n)
88
distance = 0
99
count = 0
1010
is_counting = false
11-
(0...binary.length).step(1) do |i|
11+
(0...binary.length).each do |i|
1212
if binary[i] == '1'
1313
if is_counting
1414
count += 1

0 commit comments

Comments
 (0)