Skip to content

Instantly share code, notes, and snippets.

View rohit20001221's full-sized avatar

rohit20001221

View GitHub Profile
@RuolinZheng08
RuolinZheng08 / backtracking_template.py
Last active November 2, 2025 23:57
[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())