```
h = Hash.new(0)
['a','b','b','c'].each{ |e| h[e] += 1 }
=>
{ a: 1, b: 2, c: 1 }
```
Created
February 3, 2023 15:59
-
-
Save covard/59b25f1ee73cdebe4f934ced15e5e25f to your computer and use it in GitHub Desktop.
Get count of array items. i.e. looking for duplicates in array
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment