https://school.programmers.co.kr/learn/courses/30/lessons/120854
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
// 내풀이
class Solution {
public int[] solution(String[] strlist) {
int[] result = new int[strlist.length];
for (int i=0;i< strlist.length;i++) {
result[i] = strlist[i].length();
}
return result;
}
}
// 잘 풀었다고 생각한 사람 풀이
public int[] solution(String[] strList) {
return Arrays.stream(strList).mapToInt(String::length).toArray();
}
'코딩 테스트 > 프로그래머스' 카테고리의 다른 글
[JAVA] 프로그래머스: 문자열 정렬하기(2) (0) | 2023.02.27 |
---|---|
[JAVA] 프로그래머스: 특정 문자 제거하기 (0) | 2023.02.20 |
[JAVA] 프로그래머스: 점의 위치 구하기 (0) | 2023.02.20 |
[JAVA] 프로그래머스: 피자 나눠 먹기(1) (0) | 2023.02.20 |
[JAVA] 프로그래머스 : 7의 개수 (0) | 2023.02.13 |