- Notifications
You must be signed in to change notification settings - Fork 98
Open
Labels
Description
def sat(s: List[int]): """ Find a sequence of 0's and 1's so that, after n_steps of swapping each adjacent (0, 1), the target sequence is achieved. Inspired by [Codeforces Problem 266 B](https://codeforces.com/problemset/problem/266/B) """ for step in range(8): for i in range(len(s) - 1): if (s[i], s[i + 1]) == (0, 1): (s[i], s[i + 1]) = (1, 0) return s == [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]Solvers, post your solutions in the comments using the following formatting:
<details><summary>Reveal solution</summary> ```python def sol(): return "world" # replace with your solution ``` </details>