Solving N Queens II in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Given an integer n, return the number of distinct solutions to the n-queens puzzle.


Input: 4
Output: 2
Explanation: There are two distinct solutions to the 4-queens puzzle as shown below.
 [".Q..",  // Solution 1

 ["..Q.",  // Solution 2

See the full details of the problem N Queens II at LeetCode

Originally posted at: