[algorithm] 문자열을 정수로 변환

인철·2024년 2월 23일
0

algorithm

목록 보기
57/91
post-thumbnail

숫자로만 이루어진 문자열 n_str이 주어질 때, n_str을 정수로 변환하여 return하도록 solution 함수를 완성해주세요.

class Solution {
    public int solution(String n_str) {
        int answer = Integer.parseInt(n_str);
        
        return answer;
    }
}
// int로 String을 직접 변환 할 수 없기 때문에
// Integer.parsenInt을 사용한다.
profile
같은글이있어도양해부탁드려요(킁킁)

0개의 댓글