Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ max-line-length=90
max_line_length=90
statistics=true
verbose=1
ignore = W503
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
FILE_PATH = str(Path(__file__).resolve().parent)

with open(
FILE_PATH +
'/ctci_recursive_staircase.testcases.json',
encoding="utf-8"
) as file1:
FILE_PATH + '/ctci_recursive_staircase.testcases.json',
encoding="utf-8"
) as file1:
TEST_CASES = json.load(file1)

with open(
FILE_PATH +
'/ctci_recursive_staircase_generalized.testcases.json',
encoding="utf-8"
) as file2:
FILE_PATH + '/ctci_recursive_staircase_generalized.testcases.json',
encoding="utf-8"
) as file2:
TEST_CASES_GENERALIZED = json.load(file2)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ def is_valid(word: str) -> bool:
if frequencies_size == 2:
frequencies_list = list(frequencies.keys())

if frequencies[frequencies_list[0]] == 1 and \
(frequencies_list[0] - 1 == 0 or
frequencies_list[0] - 1 == frequencies_list[1]):
if frequencies[frequencies_list[0]] == 1 \
and (
frequencies_list[0] - 1 == 0
or frequencies_list[0] - 1 == frequencies_list[1]):
return True

return False
4 changes: 2 additions & 2 deletions src/projecteuler/problem0004.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def problem0004(_bottom: int, _top: int) -> 'None | int':
LOGGER.debug("FOUND %d x %d = %d is Palindrome",
i, j, found_palindrome)

if (large_found_palindrome is None or
found_palindrome > large_found_palindrome):
if (large_found_palindrome is None
or found_palindrome > large_found_palindrome):
foundi = i
foundj = j
large_found_palindrome = found_palindrome
Expand Down