Created
July 4, 2019 14:03
-
-
Save cg4jins/76a9b1085d5c461ce88dbb581320a22a to your computer and use it in GitHub Desktop.
This file contains 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 { | |
fun solution(a: Int, b: Int): String { | |
val month = listOf(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) | |
val dayOfWeek = listOf("FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU") | |
var diff = 0 | |
for (i in 0 until a - 1) { | |
diff += month[i] | |
} | |
diff += (b - 1) | |
return dayOfWeek[diff%7] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment