Skip to content

New puzzle: Find a number with a number of 4s and 7s that has only 4s and 7s #9

Open
@akalai

Description

@akalai
def sat(d: int):
    """
    Find a number bigger than n whose decimal representation has k 4's and 7's where k's decimal representation
    consists only of 4's and 7's

    Inspired by [Codeforces Problem 110 A](https://codeforces.com/problemset/problem/110/A)
    """
    return d > 123456789 and set(str(str(d).count("4") + str(d).count("7"))) <= {"4", "7"}

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>

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