← 返回 salesforce 的题目列表Binary String 01 to 10 swap
类型:online_judge
Given a binary string s, such as "010110", replace all occurrences of "01" with "10" simultaneously each second, and repeat this process until there are no "01" left in the string. Return the total time (in seconds) needed for this process to complete.
Example
Input
6
010110