Skip to content

Commit d407476

Browse files
MaximSmolskiygithub-actions
and
github-actions
authored
fix: increase str conversion limit where required (TheAlgorithms#7604)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent a041b64 commit d407476

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

DIRECTORY.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
* [Modular Division](blockchain/modular_division.py)
5656

5757
## Boolean Algebra
58+
* [And Gate](boolean_algebra/and_gate.py)
5859
* [Norgate](boolean_algebra/norgate.py)
5960
* [Quine Mc Cluskey](boolean_algebra/quine_mc_cluskey.py)
6061

@@ -876,6 +877,8 @@
876877
* [Sol1](project_euler/problem_101/sol1.py)
877878
* Problem 102
878879
* [Sol1](project_euler/problem_102/sol1.py)
880+
* Problem 104
881+
* [Sol1](project_euler/problem_104/sol1.py)
879882
* Problem 107
880883
* [Sol1](project_euler/problem_107/sol1.py)
881884
* Problem 109
@@ -948,6 +951,7 @@
948951
* [Quantum Random](quantum/quantum_random.py)
949952
* [Ripple Adder Classic](quantum/ripple_adder_classic.py)
950953
* [Single Qubit Measure](quantum/single_qubit_measure.py)
954+
* [Superdense Coding](quantum/superdense_coding.py)
951955

952956
## Scheduling
953957
* [First Come First Served](scheduling/first_come_first_served.py)
@@ -1037,7 +1041,6 @@
10371041
* [Can String Be Rearranged As Palindrome](strings/can_string_be_rearranged_as_palindrome.py)
10381042
* [Capitalize](strings/capitalize.py)
10391043
* [Check Anagrams](strings/check_anagrams.py)
1040-
* [Check Pangram](strings/check_pangram.py)
10411044
* [Credit Card Validator](strings/credit_card_validator.py)
10421045
* [Detecting English Programmatically](strings/detecting_english_programmatically.py)
10431046
* [Dna](strings/dna.py)
@@ -1046,6 +1049,8 @@
10461049
* [Indian Phone Validator](strings/indian_phone_validator.py)
10471050
* [Is Contains Unique Chars](strings/is_contains_unique_chars.py)
10481051
* [Is Palindrome](strings/is_palindrome.py)
1052+
* [Is Pangram](strings/is_pangram.py)
1053+
* [Is Spain National Id](strings/is_spain_national_id.py)
10491054
* [Jaro Winkler](strings/jaro_winkler.py)
10501055
* [Join](strings/join.py)
10511056
* [Knuth Morris Pratt](strings/knuth_morris_pratt.py)
@@ -1090,6 +1095,7 @@
10901095
* [Fetch Well Rx Price](web_programming/fetch_well_rx_price.py)
10911096
* [Get Imdb Top 250 Movies Csv](web_programming/get_imdb_top_250_movies_csv.py)
10921097
* [Get Imdbtop](web_programming/get_imdbtop.py)
1098+
* [Get Top Billioners](web_programming/get_top_billioners.py)
10931099
* [Get Top Hn Posts](web_programming/get_top_hn_posts.py)
10941100
* [Get User Tweets](web_programming/get_user_tweets.py)
10951101
* [Giphy](web_programming/giphy.py)

project_euler/problem_104/sol.py.FIXME renamed to project_euler/problem_104/sol1.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
the last nine digits are 1-9 pandigital, find k.
1414
"""
1515

16+
import sys
17+
18+
sys.set_int_max_str_digits(0) # type: ignore
19+
1620

1721
def check(number: int) -> bool:
1822
"""
@@ -34,7 +38,7 @@ def check(number: int) -> bool:
3438
check_front = [0] * 11
3539

3640
# mark last 9 numbers
37-
for x in range(9):
41+
for _ in range(9):
3842
check_last[int(number % 10)] = 1
3943
number = number // 10
4044
# flag
@@ -51,7 +55,7 @@ def check(number: int) -> bool:
5155
# mark first 9 numbers
5256
number = int(str(number)[:9])
5357

54-
for x in range(9):
58+
for _ in range(9):
5559
check_front[int(number % 10)] = 1
5660
number = number // 10
5761

@@ -81,7 +85,7 @@ def check1(number: int) -> bool:
8185
check_last = [0] * 11
8286

8387
# mark last 9 numbers
84-
for x in range(9):
88+
for _ in range(9):
8589
check_last[int(number % 10)] = 1
8690
number = number // 10
8791
# flag

0 commit comments

Comments
 (0)