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 March 28, 2024 18:48
[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())