Redirecting to
NADOS
- Permutation - 1
- Permutations - 2
- Combinations - 1
- Combinations - 2
- Queens Permutations - 2d As 2d - Queen Chooses
- Queens Combinations - 2d As 2d - Box Chooses
- Queens Permutations - 2d As 2d - Box Chooses
- Queens Combinations - 2d As 2d - Queen Chooses
- Queens Combinations - 2d As 1d - Queen Chooses
- Nqueens Permutations - 2d As 1d - Queen Chooses
- Nqueens Combinations - 2d As 1d - Queen Chooses
- N Queens - Branch And Bound
- Nknights Combinations - 2d As 1d - Knight Chooses
- Permutations - Words - 1
- Permutations - Words - 2
- Words - K Selection - 1
- Words - K Selection - 2
- Words - K Selection - 3
- Words - K Selection - 4
- Words - K Length Words - 1
- Words - K Length Words - 2
- Words - K Length Words - 3
- Words - K Length Words - 4
- Coin Change - Combinations - 1
- Coin Change - Combinations - 2
- Coin Change - Permutations - 1
- Coin Change - Permutations - 2
- Solve Sudoku
- Crossword Puzzle
- Cryptarithmetic
- Gold Mine - 2
- Josephus Problem
- Lexicographical Numbers
- Friends Pairing - 2
- K-partitions
- K Subsets With Equal Sum
- Abbreviation Using Backtracking
- Max Score
- All Palindromic Permutations
- All Palindromic Partitions
- Pattern Matching
- Word Break - I
- Remove Invalid Parenthesis
- Tug Of War
- Largest Number Possible After At Most K Swaps
- Magnets
- Abbreviations using Backtracking
- Max Score
- N Queens Branch and Bound
- Josephus Problem
- Permutations - 1
- Lexicographical Numbers
- Gold Mine - 2
- Maximum Number After K Swaps
- K Length Words-3
- Permutations - 2
- Coin Change Combination-2
- Combinations - 1
- Friends Pairing - 2
- Remove Invalid Parentheses
- Sudoku Solver
- Word break-1
- Words - K Selection - 2
- Tug Of War
- K Subsets with Equal Sum
- Combinations - 2
- Nqueens Combinations - 2d As 1d - Queen Chooses
- Queens Combinations - 2d As 1d - Queen Chooses
- Cryptarithmetic
- Coin change combination-1
- Coin Change Permutations-2
- Coin Change Permutations-1
- K - Partitions
- All Palindromic Partitions
- Queens Combinations - 2d As 2d - Box Chooses
- Queens Permutations - 2d As 2d - Queen Chooses
- Queens Permutations - 2d As 2d - Box Chooses
- Queens Combinations - 2d As 2d - Queen Chooses
- Nknights Combinations - 2d As 1d - Knight Chooses
- Nqueens Permutations - 2d As 1d - Queen Chooses
- Permutations words-1
- Permutations Words-2
- Words - K Selection - 1
- Words-k length words-1
- Words-K Length Words-2
- Words - K Selection - 3
- Words - K Selection - 4
- Words-K Length Words-4
Queens Combinations - 2d As 1d - Queen Chooses
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.1. You are given a number n, representing the size of a n * n chess board.Input Format
2. You are required to calculate and print the combinations in which n queens can be placed on the
n * n chess-board.
Note -> Use the code snippet and follow the algorithm discussed in question video. The judge can't
force you but the intention is to teach a concept. Play in spirit of the question.
A number nOutput Format
Check the sample output and question videoQuestion Video Constraints
1 <= n <= 5Sample Input
2Sample Output
q q
- -
q -
q -
q -
- q
- q
q -
- q
- q
- -
q q
-
Asked in Companies
-
Related Topics
Your profile is incomplete!
Please click here to complete your profile to continue submitting questions.
Video Solution
Code Solution
{ }
Editor Settings
Font Size
Key Binding
Keyboard Shortcut
- fold Alt-L|Ctrl-F1
- unfold Alt-Shift-L|Ctrl-Shift-F1
- Gotoend Ctrl-End
- Gotostart Ctrl-Home
- Movelinesup Alt-Up
- Movelinesdown Alt-Down
- Undo Ctrl-Z
- Redo Ctrl-Shift-Z|Ctrl-Y
- Replace Ctrl-H
- Togglecomment Ctrl-/
- ToggleBlockComment Ctrl-Shift-/
- Removeline Ctrl-D
{ }
Run
Editor Settings
Font Size
Key Binding
Keyboard Shortcut
- fold Alt-L|Ctrl-F1
- unfold Alt-Shift-L|Ctrl-Shift-F1
- Gotoend Ctrl-End
- Gotostart Ctrl-Home
- Movelinesup Alt-Up
- Movelinesdown Alt-Down
- Undo Ctrl-Z
- Redo Ctrl-Shift-Z|Ctrl-Y
- Replace Ctrl-H
- Togglecomment Ctrl-/
- ToggleBlockComment Ctrl-Shift-/
- Removeline Ctrl-D