Created
July 7, 2020 09:12
-
-
Save dalcon10028/14d249430a28b5265bb39a03ab78d343 to your computer and use it in GitHub Desktop.
프로그래머스 코딩테스트 연습 Level1 - 2016년 [ Java ]
This file contains hidden or 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 { | |
public String solution(int a, int b) { | |
String[] week = new String[] {"THU","FRI","SAT","SUN","MON","TUE","WED"}; | |
int[] month = new int[] {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | |
int cal = 0; | |
for(int i=0; i<a-1; i++) | |
cal+=month[i]; | |
return week[(cal+b)%7]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment