You are viewing a single comment's thread. Return to all comments →
Why do you iterate over the string when re already does the iteration in the background? just
re
print('YES' if re.search(thepattern, thestring) else 'NO')
would be fine
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank in a String!
You are viewing a single comment's thread. Return to all comments →
Why do you iterate over the string when
re
already does the iteration in the background? justwould be fine