hackerrank.com

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

건이두 2019. 4. 3. 12:46
728x90

hackerrank.com

Re.findall() & Re.finditer()

Problem Link : https://www.hackerrank.com/challenges/re-findall-re-finditer/problem

Difficulty : Easy, this is not easy, it should be Medium at lest

Tip

  • Problem is not easy, and quite tricky
  • We are going to approach a bit different, unlike discussion in the problem.
  • Cs is consonants
  • Vs is vowels
  • Pattern is like [Cs][Vs][Vs]+[Cs]
  • Find this pattern first
  • Remove Cs in both beginning, and ending
  • Print only vowels
  • And replace found vowel from string
  • We repeat it until, we don't find the pattern

Solution

 

728x90