mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Pyupgrade to Python 3.9 (#4718)
* Pyupgrade to Python 3.9 * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -75,14 +75,14 @@ Applying this two formulas we can check if a queen in some position is being att
|
||||
for another one or vice versa.
|
||||
|
||||
"""
|
||||
from typing import List
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def depth_first_search(
|
||||
possible_board: List[int],
|
||||
diagonal_right_collisions: List[int],
|
||||
diagonal_left_collisions: List[int],
|
||||
boards: List[List[str]],
|
||||
possible_board: list[int],
|
||||
diagonal_right_collisions: list[int],
|
||||
diagonal_left_collisions: list[int],
|
||||
boards: list[list[str]],
|
||||
n: int,
|
||||
) -> None:
|
||||
"""
|
||||
@ -139,7 +139,7 @@ def depth_first_search(
|
||||
|
||||
|
||||
def n_queens_solution(n: int) -> None:
|
||||
boards: List[List[str]] = []
|
||||
boards: list[list[str]] = []
|
||||
depth_first_search([], [], [], boards, n)
|
||||
|
||||
# Print all the boards
|
||||
|
Reference in New Issue
Block a user