title: How to group identical elements in Ruby array
body: <p>I have the following:</p>
  
  <pre><code>array = ["John", "Mike", "Bob", "Mike", "Bob"]
  </code></pre>
  
  <p>i want to get output:</p>
  
  <pre><code>[["Mike", "Mike"], ["Bob", "Bob"], ["John"]]
  </code></pre>