require 'numbers_and_words'
def convert(locale, numbers)
I18n.with_locale locale do
numbers.map { |i| i.to_words.length }
end
end
def eliminate(locale, numbers = (1..99).to_a)
eliminated = convert(locale, numbers).uniq
if (numbers - eliminated).empty?
eliminated
else
eliminate(locale, eliminated)
end
end
%i[en es ru fr ua hu lt lv et tr de it nl se].each do |locale|
print "#{locale}: #{eliminate(locale).join ', '}\n"
end
results:
so if i'm not mistaken 4 is four letters long on most of these languages, but you can see there are some other destinations on other languages