Advertisement
k1alo

11111

Nov 29th, 2024
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.11 KB | None | 0 0
  1. s = "1" * 10 + "2" * 7
  2. while "12" in s:
  3.     s = s.replace("12", "4", 1)
  4.     c = s.count("1")
  5. print(s, c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement