mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-26 21:58:56 +01:00
fix lint
This commit is contained in:
parent
351bdc393f
commit
12c69e8429
1 changed files with 4 additions and 4 deletions
|
@ -33,18 +33,18 @@
|
||||||
def fizz_buzz(n)
|
def fizz_buzz(n)
|
||||||
str = []
|
str = []
|
||||||
fizz_buzz = {}
|
fizz_buzz = {}
|
||||||
fizz_buzz[3] = "Fizz"
|
fizz_buzz[3] = 'Fizz'
|
||||||
fizz_buzz[5] = "Buzz"
|
fizz_buzz[5] = 'Buzz'
|
||||||
|
|
||||||
n.times do |i|
|
n.times do |i|
|
||||||
i += 1
|
i += 1
|
||||||
num_str = ""
|
num_str = ''
|
||||||
|
|
||||||
fizz_buzz.each do |key, value|
|
fizz_buzz.each do |key, value|
|
||||||
num_str += value if i % key == 0
|
num_str += value if i % key == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
num_str = i.to_s if num_str == ""
|
num_str = i.to_s if num_str == ''
|
||||||
|
|
||||||
str.push(num_str)
|
str.push(num_str)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue