Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
elegant, advanced RegExp solution solution in Clear category for Three Words by leggewie
import re
def checkio(words):
return bool(re.search('((^|\s)\D+){3}', words))
# This is a minor improvement on the awesome solution by gyahun_dash
# https://py.checkio.org/mission/three-words/publications/gyahun_dash/python-3/4th/share/517356748fe5f36f7d2a81e35bd8b042/
# explanation.
# (^|\s) - check for beginning of line or space character
# \D+ - greedy match for as many non-digit characters as possible
# {3} - look for 3 occurrences of (^|\s)\D+)
#
# if there is a match, True is returned, otherwise False
May 22, 2021
Comments: