Skip to content

Commit

Permalink
한 번만 등장한 문자
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed May 8, 2023
1 parent 0a3c013 commit 9c917bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Programmers/exam69.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function solution(s) {
var answer = [];
for (let i = 0; i < s.length; i++) {
let count = 0;
for (let j = 0; j < s.length; j++) {
if (s[i] === s[j] && i !== j) count++;
}
if (count === 0) answer.push(s[i]);
}
return answer.sort().join("");
}

0 comments on commit 9c917bd

Please sign in to comment.