We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d331a5b commit 7fc9e11Copy full SHA for 7fc9e11
count_div.rb
@@ -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
+def solution(a, b, k)
+ ((b/k.to_f).floor - (a/k.to_f).ceil) + 1
4
end
0 commit comments