mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
Coding style change for project_euler problem 36 and 35 (#3062)
* add problem url. Add typehint, default value and doctest * run black * add project url. add solution function for problem 35 * add space between imports on problem 35 * Update sol1.py * Update sol1.py Co-authored-by: Dhruv <dhruvmanila@gmail.com>
This commit is contained in:
@ -1,4 +1,9 @@
|
||||
"""
|
||||
Project Euler Problem 35
|
||||
https://projecteuler.net/problem=35
|
||||
|
||||
Problem Statement:
|
||||
|
||||
The number 197 is called a circular prime because all rotations of the digits:
|
||||
197, 971, and 719, are themselves prime.
|
||||
There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73,
|
||||
@ -65,5 +70,13 @@ def find_circular_primes(limit: int = 1000000) -> list[int]:
|
||||
return result
|
||||
|
||||
|
||||
def solution() -> int:
|
||||
"""
|
||||
>>> solution()
|
||||
55
|
||||
"""
|
||||
return len(find_circular_primes())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"{len(find_circular_primes()) = }")
|
||||
|
Reference in New Issue
Block a user