Ad
  • Custom User Avatar

    You're right, s.split.all? { |w| numbers.include?(w) } is cleaner, I didn't know all? could receive a block.

    Your second suggestion, I know it's faster, but unless you are doing a few thousand/million iterations, the speed wont be noticeable. The code I wrote feels more human readable, which makes it more valuable code in my books.