Skip to content

Commit 7fc9e11

Browse files
authored
Update count_div.rb
1 parent d331a5b commit 7fc9e11

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

count_div.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
def solution(a)
2-
return 0 if a.length != a.uniq.length
3-
(1..a.length).inject(:+) == a.inject(:+)? 1 : 0
1+
def solution(a, b, k)
2+
((b/k.to_f).floor - (a/k.to_f).ceil) + 1
43
end

0 commit comments

Comments
 (0)