Check if we have reached the 8 th row and 9 th column ( 0 indexed matrix ) , we are returning true to avoid further backtracking
if ( row == N - 1 and col == N ) : NEW_LINE INDENT return True NEW_LINE DEDENT