Develop
[프로그래머스] Error :: bad return type in lambda expression 본문
https://sseb32310.tistory.com/52
이 프로그래머스 문제를 stream으로 풀다가 난 오류
이게 무슨 오류인가 싶어서 찾아보았는데
람다표현식 리스트 -> 배열로 변경하면서 나오는 타입문제라고 한다.
해결 방법
: List를 만들어줄 때 타입을 지정하기
List<Integer> answer = new ArrayList();
or
List<Integer> answer = newArrayList<Integer>();
but 나는 괄호를 제대로 열고 닫지 않아서 나온 에러였다..
.toArray()가 밖에 있어야하는데 안에 입력해서 이상한거였음!
참고한 글
'개인 공부 > 프로그래머스' 카테고리의 다른 글
[프로그래머스] 수열과 구간 쿼리3 (0) | 2024.01.29 |
---|---|
[프로그래머스] 문자열로 변환 (int -> String 변환 방법 3가지) (0) | 2024.01.28 |
[프로그래머스] 수열과 구간 쿼리2 (1) | 2024.01.27 |
[프로그래머스] 수 조작하기2 (0) | 2024.01.26 |
[프로그래머스] 수 조작하기1 (1) | 2024.01.25 |