Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 162 characters in body
Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 43 bytes

function(s)grep("[^aeiouy]{2}",paste(s,""))

Try it online!

A port of Arnauld's JavaScript answer; returns 1 for weak words and integer(0) for strong onesones; it appends a (space) to the end of the string.

This is actually vectorized; with a vector of strings, it returns the indices (1-based) of the weak words.

R, 43 bytes

function(s)grep("[^aeiouy]{2}",paste(s,""))

Try it online!

A port of Arnauld's JavaScript answer; returns 1 for weak words and integer(0) for strong ones

R, 43 bytes

function(s)grep("[^aeiouy]{2}",paste(s,""))

Try it online!

A port of Arnauld's JavaScript answer; returns 1 for weak words and integer(0) for strong ones; it appends a (space) to the end of the string.

This is actually vectorized; with a vector of strings, it returns the indices (1-based) of the weak words.

Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 43 bytes

function(s)grep("[^aeiouy]{2}",paste(s,""))

Try it online!

A port of Arnauld's JavaScript answer; returns 1 for weak words and integer(0) for strong ones

AltStyle によって変換されたページ (->オリジナル) /