Skip to content

Instantly share code, notes, and snippets.

View ZohebMOPO's full-sized avatar
💭
Mystery

Zoheb Alli Khan ZohebMOPO

💭
Mystery
View GitHub Profile
@RuolinZheng08
RuolinZheng08 / backtracking_template.py
Last active September 9, 2024 08:42
[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())