Skip to main content
added 58 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Husk, 1212 8 bytes

►=fImLmf√ġK√►=mLmf√w 

Try it online!Try it online!

Previous answer was badly optimized.(-4 bytes)

From Zgarb:

► has a second mode. If you give it a binary function f, it returns an element x that maximizes the number of elements y for which fxy holds.

So ►= is a 2-byte max by frequency.

Explanation

►=fImLmf√ġK√ ġK√ group string on non alphabet-characters. f√ filter out non-alphabet characters m map that to each word ↑ mL Length of each word fI filter out zeroes (empty string length) ►= max by frequency 

Husk, 12 bytes

►=fImLmf√ġK√ 

Try it online!

From Zgarb:

► has a second mode. If you give it a binary function f, it returns an element x that maximizes the number of elements y for which fxy holds.

So ►= is a 2-byte max by frequency.

Explanation

►=fImLmf√ġK√ ġK√ group string on non alphabet-characters. f√ filter out non-alphabet characters m map that to each word ↑ mL Length of each word fI filter out zeroes (empty string length) ►= max by frequency 

Husk, 12 8 bytes

►=mLmf√w 

Try it online!

Previous answer was badly optimized.(-4 bytes)

From Zgarb:

► has a second mode. If you give it a binary function f, it returns an element x that maximizes the number of elements y for which fxy holds.

So ►= is a 2-byte max by frequency.

Explanation

►=fImLmf√ġK√ ġK√ group string on non alphabet-characters. f√ filter out non-alphabet characters m map that to each word ↑ mL Length of each word fI filter out zeroes (empty string length) ►= max by frequency 
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Husk, 12 bytes

►=fImLmf√ġK√ 

Try it online!

From Zgarb:

► has a second mode. If you give it a binary function f, it returns an element x that maximizes the number of elements y for which fxy holds.

So ►= is a 2-byte max by frequency.

Explanation

►=fImLmf√ġK√ ġK√ group string on non alphabet-characters. f√ filter out non-alphabet characters m map that to each word ↑ mL Length of each word fI filter out zeroes (empty string length) ►= max by frequency