I'm using Ruby 2.4. Let's say I have an array of strings (which are all just string-i-fied (is that a word?) integers ...
["1", "2", "5", "25", "5"]
How do I write a function that tells me if all the elements in the array occur no more than twice in the array? For example, this array
["1", "3", "3", "55", "3", "2"]
would return false
because "3"
occurs three times, but this array
["20", "10", "20", "10"]
would return true
because none of the elements occur more than twice.