From bd72d172e433235306c02d30efe1bd5519cb638c Mon Sep 17 00:00:00 2001 From: rl544 <111494264+rl544@users.noreply.github.com> Date: Sat, 17 Dec 2022 21:24:17 +0900 Subject: [PATCH] =?UTF-8?q?uploaded=20at=202022.=2012.=2017.=20=EC=98=A4?= =?UTF-8?q?=ED=9B=84=209:24:16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- programmers/서울에서 김서방 찾기/solution.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 programmers/서울에서 김서방 찾기/solution.java diff --git a/programmers/서울에서 김서방 찾기/solution.java b/programmers/서울에서 김서방 찾기/solution.java new file mode 100644 index 0000000..89d5bb0 --- /dev/null +++ b/programmers/서울에서 김서방 찾기/solution.java @@ -0,0 +1,15 @@ +// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/12919 + +class Solution { + public String solution(String[] seoul) { + int n = 0; + for(int a = 0; a < seoul.length; a++){ + if(seoul[a].equals("Kim")) { + n = a; + break; + } + } + String answer = "김서방은 "+n+"에 있다"; + return answer; + } +} \ No newline at end of file