Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try replicating the steps from the problem statement.
Perform the replacements simultaneously, and return the number of times the process repeats.
Solve with full IDE support and test cases