반응형
```
백준 25277번 Culture shock
```
이번 글을 통해 배워갈 내용
- 백준 25277번 풀이
https://www.acmicpc.net/problem/25277
25277번: Culture shock
Thore is a visiting scholar at a progressive university, whose administrators have decided that gendered pronouns are politically incorrect. The pronouns he, she, him, and her must be replaced with the gender neutral they and them. Thore doesn't want to ap
www.acmicpc.net
백준 25277번 Culture shock는
난이도 브론즈 등급의 문제로서
주어진 문자열 리스트에서
he, him, she, her을 카운팅 해주면 되는 문제입니다.
30분 정도 위에 링크를 방문하셔서 풀어보시고
안 풀리시는 경우에만 아래 해답을 봐주시면 감사하겠습니다.
입력을 받고 스트림 필터를 돌려서 숫자를 세서 출력했습니다.
fun main(args: Array<String>) {
val cnt = readln().toInt()
val words = readln().split(" ")
print(words.filter { s -> arrayOf("he", "him", "she", "her").contains(s) }.size)
}
// https://codemasterkimc.tistory.com/
읽어주셔서 감사합니다
무엇인가 얻어가셨기를 바라며
오늘도 즐거운 코딩 하시길 바랍니다 ~ :)
728x90
반응형
'Kotlin > Kotlin 알고리즘' 카테고리의 다른 글
백준 8437번 Julka Kotlin 구현해보기 (0) | 2022.10.08 |
---|---|
백준 20154번 이 구역의 승자는 누구야?! Kotlin 구현해보기 (0) | 2022.10.08 |
백준 25286번 11월 11일 Kotlin 구현해보기 (0) | 2022.10.05 |
백준 25640번 MBTI Kotlin 구현해보기 (0) | 2022.10.04 |
백준 25641번 균형 잡힌 소떡소떡 (0) | 2022.10.04 |