質問編集履歴
1
コードがまちがっていました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
ただし、同じ数字が二回以上出てきたら、0をかえすことにします。
|
3
3
|
|
4
4
|
```ruby
|
5
|
-
def count_distinct_numbers(
|
5
|
+
def count_distinct_numbers(ary)
|
6
6
|
???
|
7
7
|
end
|
8
8
|
|
9
|
-
p count_distinct_numbers([1, 2, 3, 5, 8] #=> 5
|
9
|
+
p count_distinct_numbers([1, 2, 3, 5, 8]) #=> 5
|
10
|
-
p count_distinct_numbers([1, 1, 2, 3, 5, 8] #=> 0
|
10
|
+
p count_distinct_numbers([1, 1, 2, 3, 5, 8]) #=> 0
|
11
11
|
```
|