Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21.02.07 - [BOJ] 10808. 알파벳 개수 #2

Closed
suhyunsim opened this issue Feb 9, 2021 · 0 comments
Closed

21.02.07 - [BOJ] 10808. 알파벳 개수 #2

suhyunsim opened this issue Feb 9, 2021 · 0 comments
Assignees
Labels
문자열 문자열 브론즈 BOJ - 브론즈 성공 맞은 문제

Comments

@suhyunsim
Copy link
Owner

문제

핵심 아이디어

  • ASCII 코드를 십진수로 변환
  • 배열에 해당 인덱스의 값을 1 증가

어려운 점, 실수

풀이

package main.java.com.poogle.BOJ.Q10808;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        int[] result = new int[26];
        for (int i = 0; i < s.length(); i++) {
            result[s.charAt(i) - 97]++;
        }
        for (int i : result) {
            System.out.print(i + " ");
        }
    }
}
@suhyunsim suhyunsim added 성공 맞은 문제 구현 브론즈 BOJ - 브론즈 labels Feb 9, 2021
@suhyunsim suhyunsim self-assigned this Feb 9, 2021
@suhyunsim suhyunsim added the 문자열 문자열 label Feb 9, 2021
@suhyunsim suhyunsim added this to the 2월 1주 차 milestone Feb 14, 2021
@suhyunsim suhyunsim changed the title 21.02.09 - [BOJ] 10808. 알파벳 개수 21.02.07 - [BOJ] 10808. 알파벳 개수 Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
문자열 문자열 브론즈 BOJ - 브론즈 성공 맞은 문제
Projects
None yet
Development

No branches or pull requests

1 participant