Created
July 24, 2019 08:52
-
-
Save cg4jins/c3fb6de17279726b9ceff08dfd4eedbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
fun solution(seoul: Array<String>): String { | |
for ((idx, word) in seoul.withIndex()){ | |
if (word == "Kim"){ | |
return "김서방은 ${idx}에 있다" | |
} | |
} | |
return "" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
오! withIndex 이용하면 int i 방식 사용 안해도 되겠군요