microsoft / PythonProgrammingPuzzles

A Dataset of Python Challenges for AI Research
MIT License
966 stars 94 forks source link

New puzzle based on codeforces 133 A (harder) #17

Open akalai opened 3 years ago

akalai commented 3 years ago
def sat(s: str):
    """
    Find a string with certain characters, simple codeforces problem

    Inspired by [Codeforces Problem 133 A](https://codeforces.com/problemset/problem/133/A)
    """
    for c in ["H", "Q", "9"]:
        if s.count(c) != 17:
            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

sofiavempala commented 3 years ago
Reveal solution ```python def sol(): return "world" # "HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9HQ9H9Q" ```
masak commented 3 years ago
Reveal solution ```python def sol(): return "HQ9" * 17 ```