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: Find a number with a number of 4s and 7s that has only 4s and 7s #9

Description

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>

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