How do I find the unique number in an array and return only that number in ruby?

前端 未结 0 1961

There is an array with some numbers. All numbers are equal except for one. I\'m trying to get this type of thing:

find_uniq([ 1, 1, 1, 2, 1, 1 ]) == 2

find_u         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题