✏️ 문제풀이/프로그래머스

[프로그래머스/Java] Lv0. 배열 원소의 길이

bono-hye 2025. 1. 25. 23:51

| 문제

https://school.programmers.co.kr/learn/courses/30/lessons/120854

 

프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

| 풀이

class Solution {
    public int[] solution(String[] strlist) {
        int[] answer = new int[strlist.length];
        for(int i=0; i<strlist.length; i++)
            answer[i] = strlist[i].length();
        return answer;
    }
}