[ruby] How to find and return a duplicate value in array