11 ms·
Shorter ruby version: phrase.split.select{|x| x.count("aeiou")<=2}.max_by(&:length) The enumerable module of Ruby provides many methods that can be easily imp
by llmzero 3y ago
Shorter ruby version:
phrase.split.select{|x| x.count("aeiou")<=2}.max_by(&:length)
The enumerable module of Ruby provides many methods that can be easily implemented in J. Just to show one of them
max_by =: 1 : '{~ (i. >./)@:(u&>)'
For example the list.max_by(&:length) is (# max_by)