-
[프로그래머스] 글자 이어 붙여 문자열 만들기알고리즘 노트 2023. 10. 17. 10:56
주어진 index list를 활용하여 문자열 내 글자를 하나의 단어로 만들어내는 문제입니다.
다양한 라이브러리를 활용하면 한 줄로 완성할 수 있지요.
[문제풀이]
1. index_list를 통해 Object를 만들어 냅니다. mapToObj를 통해 Stream<String> 컬렉션을 만들고 이를 joining() 메소드로 합쳐서 하나의 문장으로 만들어 내면 끝납니다.
'알고리즘 노트' 카테고리의 다른 글
[프로그래머스] 문자열 여러번 뒤집기 (0) 2023.10.17 [프로그래머스] 9로 나눈 나머지 (0) 2023.10.17 [프로그래머스] 주사위 게임 3 (0) 2023.10.17 [프로그래머스] 간단한 논리 연산 (0) 2023.10.17 [프로그래머스] 배열 만들기 4 (0) 2023.10.16