Either I don't understand what happens when you subtract an array from an array, or something is wrong here.
What I have is a list of usernames (strings) in an array:
users.count - users.uniq.count # => 9
users - users.uniq # => []
I'm not sure how this is possible.
I'm essentially trying to find a list of the duplicates. I realize there are other ways to go about this, just trying to understand Array operations better.
Here is the workaround code I used to get the same:
users.inject(Hash.new(0)) {|h,i| h[i] += 1; h}.select{|k,v| v > 1}