public String solution(String[] seoul) { int cnt = 0; for (String string : seoul) { if (string.equals("Kim")) break; cnt++; } return "김서방은 " + cnt + "에 있다"; }
출처:https://school.programmers.co.kr/learn/courses/30/lessons/12919