I am getting TLE verdict in this problem. It’d be a huge help if someone can tell me where I went wrong. Thanks in advance. This problem came in APAT for web dev (the test is over now.)
Problem:
You are given N, and for a given N x N chessboard, find a way to place N Kings such that no king can attack any other king on the chess board. Each row and column should contain exactly one king. You have to print total number of such configurations.
Input Format:
A single integer N
My solution:
https://hack.codingblocks.com/submission/1899062