Skip to content

Instantly share code, notes, and snippets.

View SSB2000's full-sized avatar
💭
Focusing

Shubham singh bohra SSB2000

💭
Focusing
View GitHub Profile
@SSB2000
SSB2000 / backtracking_template.py
Created July 29, 2021 12:32 — forked from RuolinZheng08/backtracking_template.py
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())