Skip to content

Instantly share code, notes, and snippets.

View adarsh415's full-sized avatar

adarsh kumar pandey adarsh415

  • Bangalore
View GitHub Profile
@adarsh415
adarsh415 / backtracking_template.py
Created July 4, 2022 14:08 — 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())