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
Combinations - 2
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 give a number of boxes (nboxes) and number of identical items (ritems).Input Format
2. You are required to place the items in those boxes and print all such configurations possible.
Items are identical and all of them are named 'i'
Note 1 -> Number of boxes is greater than number of items, hence some of the boxes may remain
empty.
Note 2 -> Check out the question video and write the recursive code as it is intended without
changing signature. The judge can't force you but intends you to teach a concept.
Input is managed for youOutput Format
Check the sample ouput and question video. - means empty box, i means occupied by item.Question Video Constraints
0 < nboxes <= 10Sample Input
0 <= ritems <= nboxes
5Sample Output
3
iii--
ii-i-
ii--i
i-ii-
i-i-i
i--ii
-iii-
-ii-i
-i-ii
--iii
-
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