Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New puzzle from codeforces 136 A #13

Open
akalai opened this issue Jul 12, 2021 · 0 comments
Open

New puzzle from codeforces 136 A #13

akalai opened this issue Jul 12, 2021 · 0 comments

Comments

@akalai
Copy link
Contributor

akalai commented Jul 12, 2021

def sat(indexes):
    """
    Given a list of integers representing a permutation, invert the permutation.

    Inspired by [Codeforces Problem 136 A](https://codeforces.com/problemset/problem/136/A)
    """
    target=[1, 3, 4, 2, 5, 6, 7]
    for i in range(1, len(target) + 1):
        if target[indexes[i - 1] - 1] != i:
            return False
    return True

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant