Not able to understand the given code provided

i am able to understand the code given by you along with this video in this unit - advanced backtracking recursion. plz help me out to understand the code.