가위 바위 보

han.user();·2023년 3월 31일
0

프로그래머스

목록 보기
11/87
post-thumbnail

class Solution {
    public String solution(String rsp) {
        String answer = "";
        
        for (int i = 0; i < rsp.length(); i++) {
            char c = rsp.charAt(i);
            if(c=='2') {
                answer += "0";
            } else if (c =='0'){
                answer += "5";
            } else if (c =='5'){
                answer += "2";
            }
        }
        return answer;
    }
}
profile
I'm still hungry.

0개의 댓글