Search
⌘K

Leetcode 2380. Time Needed to Rearrange a Binary String

Given a binary string where every second all occurrences of "01" simultaneously become "10", determine how many seconds until no "01" remains; the core challenge is modeling the parallel, cascading swaps to compute how far ones must move past zeros (can be solved in O(n)).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.