My aim is to display the number of identical elements in an array.

Here is my code:

```
a = [5, 2, 4, 1, 2]
b = []
for i in a
  unless b.include?(a[i])
    b << a[i]
    print i," appears ",a.count(i)," times\n"
  end
end

```

I get this output:

```
5 appears 1 times
2 appears 2 times
4 appears 1 times

```

The output misses `1`.