`{"id":"f1da9898-d996-49da-85f1-069c0d36ae23","name":"Crossword Puzzle","description":"1. You are given a 10*10 2-D array(arr) containing only '+' and '-' characters, which represents a \r\n crossword puzzle. \r\n2. You are also given n number of words which need to be filled into the crossword.\r\n3. Cells containing '-' are to be filled with the given words.\r\n\r\nNote -> Check out the question video and write the recursive code as it is intended without \r\n changing signature. The judge can't force you but intends you to teach a concept.","inputFormat":"10 * 10 grid of characters containing only '+' and '-' \r\nA number n\r\nstr1\r\nstr2\r\n...n strings","outputFormat":"Check the sample output and question video","constraints":"1 &lt;= n &lt;= 10","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void solution(char[][] arr, String[] words, int vidx) {\r\n //write your code here\r\n\r\n }\r\n\r\n\r\n public static void print(char[][] arr) {\r\n for (int i = 0 ; i < arr.length; i++) {\r\n for (int j = 0 ; j < arr.length; j++) {\r\n System.out.print(arr[i][j]);\r\n }\r\n System.out.println();\r\n }\r\n\r\n }\r\n public static void main(String[] args) {\r\n Scanner scn = new Scanner(System.in);\r\n char[][] arr = new char[10][10];\r\n for (int i = 0 ; i < arr.length; i++) {\r\n String str = scn.next();\r\n arr[i] = str.toCharArray();\r\n }\r\n int n = scn.nextInt();\r\n String[] words = new String[n];\r\n for (int i = 0 ; i < words.length; i++) {\r\n words[i] = scn.next();\r\n }\r\n solution(arr, words, 0);\r\n }\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"+-++++++++\r\n+-++++++++\r\n+-++++++++\r\n+-----++++\r\n+-+++-++++\r\n+-+++-++++\r\n+++++-++++\r\n++------++\r\n+++++-++++\r\n+++++-++++\r\n4\r\nLONDON\r\nDELHI \r\nICELAND \r\nANKARA","sampleOutput":"+L++++++++\r\n+O++++++++\r\n+N++++++++\r\n+DELHI++++\r\n+O+++C++++\r\n+N+++E++++\r\n+++++L++++\r\n++ANKARA++\r\n+++++N++++\r\n+++++D++++\r\n","questionVideo":"https://www.youtube.com/embed/bmxH9h-q67o","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"082986ae-d618-4a59-9ab3-6d79056679a4","name":"Recursion and Backtracking For Intermediate","slug":"recursion-and-backtracking-for-intermediate-330","type":0},{"id":"0f5282ea-dba2-4b5a-b399-8d3e136ac12a","name":"Crossword Puzzle","slug":"crossword-puzzle","type":1}],"next":{"id":"8a49d858-7d84-475a-98fa-7d469d2c05f8","name":"Crossword Puzzle MCQ","type":0,"slug":"crossword-puzzle-mcq"},"prev":{"id":"42f82b2f-c650-4be0-93e0-e43081dd422b","name":"Solve Sudoku MCQ","type":0,"slug":"solve-sudoku-mcq"}}}`

# Crossword Puzzle

1. You are given a 10*10 2-D array(arr) containing only '+' and '-' characters, which represents a crossword puzzle. 2. You are also given n number of words which need to be filled into the crossword. 3. Cells containing '-' are to be filled with the given words. Note -> 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.

`{"id":"f1da9898-d996-49da-85f1-069c0d36ae23","name":"Crossword Puzzle","description":"1. You are given a 10*10 2-D array(arr) containing only '+' and '-' characters, which represents a \r\n crossword puzzle. \r\n2. You are also given n number of words which need to be filled into the crossword.\r\n3. Cells containing '-' are to be filled with the given words.\r\n\r\nNote -> Check out the question video and write the recursive code as it is intended without \r\n changing signature. The judge can't force you but intends you to teach a concept.","inputFormat":"10 * 10 grid of characters containing only '+' and '-' \r\nA number n\r\nstr1\r\nstr2\r\n...n strings","outputFormat":"Check the sample output and question video","constraints":"1 &lt;= n &lt;= 10","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void solution(char[][] arr, String[] words, int vidx) {\r\n //write your code here\r\n\r\n }\r\n\r\n\r\n public static void print(char[][] arr) {\r\n for (int i = 0 ; i < arr.length; i++) {\r\n for (int j = 0 ; j < arr.length; j++) {\r\n System.out.print(arr[i][j]);\r\n }\r\n System.out.println();\r\n }\r\n\r\n }\r\n public static void main(String[] args) {\r\n Scanner scn = new Scanner(System.in);\r\n char[][] arr = new char[10][10];\r\n for (int i = 0 ; i < arr.length; i++) {\r\n String str = scn.next();\r\n arr[i] = str.toCharArray();\r\n }\r\n int n = scn.nextInt();\r\n String[] words = new String[n];\r\n for (int i = 0 ; i < words.length; i++) {\r\n words[i] = scn.next();\r\n }\r\n solution(arr, words, 0);\r\n }\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"+-++++++++\r\n+-++++++++\r\n+-++++++++\r\n+-----++++\r\n+-+++-++++\r\n+-+++-++++\r\n+++++-++++\r\n++------++\r\n+++++-++++\r\n+++++-++++\r\n4\r\nLONDON\r\nDELHI \r\nICELAND \r\nANKARA","sampleOutput":"+L++++++++\r\n+O++++++++\r\n+N++++++++\r\n+DELHI++++\r\n+O+++C++++\r\n+N+++E++++\r\n+++++L++++\r\n++ANKARA++\r\n+++++N++++\r\n+++++D++++\r\n","questionVideo":"https://www.youtube.com/embed/bmxH9h-q67o","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"082986ae-d618-4a59-9ab3-6d79056679a4","name":"Recursion and Backtracking For Intermediate","slug":"recursion-and-backtracking-for-intermediate-330","type":0},{"id":"0f5282ea-dba2-4b5a-b399-8d3e136ac12a","name":"Crossword Puzzle","slug":"crossword-puzzle","type":1}],"next":{"id":"8a49d858-7d84-475a-98fa-7d469d2c05f8","name":"Crossword Puzzle MCQ","type":0,"slug":"crossword-puzzle-mcq"},"prev":{"id":"42f82b2f-c650-4be0-93e0-e43081dd422b","name":"Solve Sudoku MCQ","type":0,"slug":"solve-sudoku-mcq"}}}`

Editor

# Crossword Puzzle

easy

1. You are given a 10*10 2-D array(arr) containing only '+' and '-' characters, which represents a crossword puzzle. 2. You are also given n number of words which need to be filled into the crossword. 3. Cells containing '-' are to be filled with the given words. Note -> 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.

1 <= n <= 10

## Format

### Input

10 * 10 grid of characters containing only '+' and '-' A number n str1 str2 ...n strings

### Output

Check the sample output and question video

## Example

Sample Input

```.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}+-++++++++ +-++++++++ +-++++++++ +-----++++ +-+++-++++ +-+++-++++ +++++-++++ ++------++ +++++-++++ +++++-++++ 4 LONDON DELHI ICELAND ANKARA```

### Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}+L++++++++ +O++++++++ +N++++++++ +DELHI++++ +O+++C++++ +N+++E++++ +++++L++++ ++ANKARA++ +++++N++++ +++++D++++ ```

Question Video

Discussions

Show Discussion

Related Resources