Skip to content

Commit d2c5549

Browse files
author
Eric
committed
112차 1번 문제풀이
1 parent aae495a commit d2c5549

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

live11/test112/문제1/황장현.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function generateAnagrams(word) {
1313

1414
function backtrack() {
1515
if (path.length === chars.length) {
16-
console.log(path.join(''));
1716
result.push(path.join(''));
1817
return;
1918
}
@@ -39,10 +38,13 @@ function generateAnagrams(word) {
3938
function solution(input) {
4039
const N = input[0][0];
4140
const words = input.slice(1).map((el) => el[0]);
41+
const output = [];
4242

4343
for (let i = 0; i < N; i++) {
44-
generateAnagrams(words[i]);
44+
const anagrams = generateAnagrams(words[i]);
45+
output.push(...anagrams);
4546
}
47+
console.log(output.join('\n'));
4648
}
4749

4850
solution(input);

0 commit comments

Comments
 (0)