import reinput_text = "abccbcbbb";k=3input_text = re.sub(fr"(.)\1{{{k-1}}}", "", input_text)print(input_text)
Standard input is empty
abccbc
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!