Skip to content

Instantly share code, notes, and snippets.

@dalcon10028
Created July 7, 2020 09:12
Show Gist options
  • Save dalcon10028/14d249430a28b5265bb39a03ab78d343 to your computer and use it in GitHub Desktop.
Save dalcon10028/14d249430a28b5265bb39a03ab78d343 to your computer and use it in GitHub Desktop.
프로그래머스 코딩테스트 연습 Level1 - 2016년 [ Java ]
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