Skip to content

Instantly share code, notes, and snippets.

@cg4jins
Created July 4, 2019 14:03
Show Gist options
  • Save cg4jins/76a9b1085d5c461ce88dbb581320a22a to your computer and use it in GitHub Desktop.
Save cg4jins/76a9b1085d5c461ce88dbb581320a22a to your computer and use it in GitHub Desktop.
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