N-Queen Problem

    function isSafe(board, row, col, n):

        for i from 0 to col-1:

            if board[row][i] == 1:

                 return false

            for i,j from row-1, col-1 to 0, 0 by -1:

                 if board[i][j] == 1:

                     return false

           for i,j from row+1, col-1 to n-1, 0 by 1, -1:

                 if board[i][j] == 1:

                    return false