Skip to content

Instantly share code, notes, and snippets.

@covard
Created February 3, 2023 15:59
Show Gist options
  • Select an option

  • Save covard/59b25f1ee73cdebe4f934ced15e5e25f to your computer and use it in GitHub Desktop.

Select an option

Save covard/59b25f1ee73cdebe4f934ced15e5e25f to your computer and use it in GitHub Desktop.

Revisions

  1. covard revised this gist Feb 3, 2023. No changes.
  2. covard revised this gist Feb 3, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion array_dup_count.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```ruby
    ```
    h = Hash.new(0)
    ['a','b','b','c'].each{ |e| h[e] += 1 }
    =>
  3. covard created this gist Feb 3, 2023.
    6 changes: 6 additions & 0 deletions array_dup_count.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ```ruby
    h = Hash.new(0)
    ['a','b','b','c'].each{ |e| h[e] += 1 }
    =>
    { a: 1, b: 2, c: 1 }
    ```