Skip to content

Commit 24883a0

Browse files
committed
issue #33 백준 알파벳 찾기 자바
1 parent 4a58229 commit 24883a0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/backjoon/_10809.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
public class _10809 {
1111

1212
public static void main(String[] args) throws IOException {
13+
14+
//memory 11496 runtime 80
1315
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
1416

17+
//알파벳 배열생성 후 초기화값 -1
1518
int[] arr = new int[26];
1619
for(int i = 0; i < arr.length; i++) {
1720
arr[i] = -1;
@@ -20,7 +23,6 @@ public static void main(String[] args) throws IOException {
2023
String s = br.readLine();
2124
for(int i = 0; i < s.length(); i++) {
2225
char ch = s.charAt(i);
23-
// arr 원소 값이 -1 인 경우에만 초기화
2426
if(arr[ch - 'a'] == -1) {
2527
arr[ch - 'a'] = i;
2628
}
@@ -29,7 +31,6 @@ public static void main(String[] args) throws IOException {
2931
for(int val : arr) { // 배열 출력
3032
System.out.print(val + " ");
3133
}
32-
3334
}
3435
}
3536
/*

0 commit comments

Comments
 (0)