We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Group(), Groups() & Groupdict()
Group(), Groups() & Groupdict()
Sort by
recency
|
267 Discussions
|
Please Login in order to post a comment
import re
S = input()
fount_it = re.search(r'([a-zA-Z0-9])\1+', S)
if fount_it: print(fount_it.group(1)) else: print(-1)
S = input() found_it= False for i in range(len(S)-1): j=S[i] if j.isalnum() is True and S[i+1]==j: found_it = True print(j) break if found_it is False: print(-1)
Using regex