Skip to content

Instantly share code, notes, and snippets.

View Adwaith-Rajesh's full-sized avatar
:octocat:
Coding for fun.

Adwaith Rajesh Adwaith-Rajesh

:octocat:
Coding for fun.
View GitHub Profile
@Adwaith-Rajesh
Adwaith-Rajesh / backtracking_template.py
Created October 29, 2021 05:43 — 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())