프로그래머스 2016년 - java


프로그래머스 2016년 - java

class Solution { public String solution(int a, int b) { String answer = ""; int[] dates = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int totalDates = 0; for (int i = 0 ; i < a-1 ; i++) { totalDates += dates[i]; } totalDates += b-1; System.out.println(totalDates); String[] days = {"FRI","SAT","SUN","MON","TUE","WED","THU"}; answer = days[totalDates%7]; return answer; } } 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges...



원문링크 : 프로그래머스 2016년 - java