jmpark0118 / CODING_TEST_PRACTICE

0 stars 0 forks source link

Practice>Python>Regex and Parsing>Re.findall() & Re.finditer() #98

Open jmpark0118 opened 3 years ago

jmpark0118 commented 3 years ago

image image image

출처 : https://www.hackerrank.com/challenges/re-findall-re-finditer/problem

jmpark0118 commented 3 years ago

import re

if __name__ == '__main__':
    consonants = 'qwrtypsdfghjklzxcvbnm'

    x = re.findall(r'(?<=['+consonants+'])([aeiou]{2,})(['+consonants+'])', input(), re.I)
    a = [i[0] for i in x]

    print('\n'.join(a or ['-1']))