(풀이)
import java.util.*;
class Main {
public String solution(String str){
String answer="";
for(int i=0; i<str.length(); i++){
//System.out.println(str.charAt(i)+" "+i+" "+str.indexOf(str.charAt(i)));
if(str.indexOf(str.charAt(i))==i) answer+=str.charAt(i);
}
return answer;
}
public static void main(String[] args){
Main T = new Main();
Scanner kb = new Scanner(System.in);
String str=kb.next();
System.out.print(T.solution(str));
}
}
'취업준비 - 코테 , 면접 > 알고리즘(코테) 공부' 카테고리의 다른 글
백준 8393번(반복문) (0) | 2023.02.20 |
---|---|
백준 2739번(반복문) (0) | 2023.02.20 |
백준 2480번 (조건문) (0) | 2023.02.11 |
백준 2525번 (조건문) (0) | 2023.02.11 |
백준 2884번 (조건문) (0) | 2023.02.11 |