[Solved] Time Needed to Rearrange a Binary String LeetCode Contest
You are given a binary string s. In one second, all occurrences of “01” are simultaneously replaced with “10”. This process repeats until no occurrences of “01” exist. Return the number of seconds needed to complete this process. Time Needed to Rearrange a Binary String LeetCode Contest Example 1: Input: s = “0110101”…