Implementation of N Queens Problem