Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

New puzzle inspired by codeforces 266B #8

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions