Skip to main content
2 of 4
added 663 characters in body
ovs
  • 61.2k
  • 3
  • 49
  • 164

05AB1E, 10 bytes

€a0¡OʒĀ}.M 

Try it online!

Commented:

€a0¡OʒĀ} implicit input "ab, cd e." €a map is_alpha [1, 1, 0, 0, 1, 1, 0, 1, 0] 0¡ split on 0 [[1, 1], [], [1, 1], [1]] O sum the lists [2, 0, 2, 1] ʒ } filter on ... [2, 2, 1] Ā ... Python-style truthy (0 is false) .M mode 2 implicit output 

a is implemented as Regex.match?(~r/^[a-zA-Z]+$/, to_string(x)), which should be equivalent to the challenge specification.

I feel like there has to be a shorter way to remove 0s from a list than ʒĀ}.

ovs
  • 61.2k
  • 3
  • 49
  • 164