mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-04 16:57:32 +08:00
Add flake8-builtins to pre-commit and fix errors (#7105)
Ignore `A003` Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
This commit is contained in:
@ -95,10 +95,10 @@ def util_hamilton_cycle(graph: list[list[int]], path: list[int], curr_ind: int)
|
||||
return graph[path[curr_ind - 1]][path[0]] == 1
|
||||
|
||||
# Recursive Step
|
||||
for next in range(0, len(graph)):
|
||||
if valid_connection(graph, next, curr_ind, path):
|
||||
for next_ver in range(0, len(graph)):
|
||||
if valid_connection(graph, next_ver, curr_ind, path):
|
||||
# Insert current vertex into path as next transition
|
||||
path[curr_ind] = next
|
||||
path[curr_ind] = next_ver
|
||||
# Validate created path
|
||||
if util_hamilton_cycle(graph, path, curr_ind + 1):
|
||||
return True
|
||||
|
Reference in New Issue
Block a user