SHARE
TWEET

Untitled

a guest Jul 16th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Solution {
  2.     fun solution(a: Int, b: Int): String {        
  3.         val month = listOf(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
  4.         val dayOfWeek = listOf("FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU")
  5.         var diff = 0
  6.  
  7.         for (i in 0 until a - 1) {
  8.             diff += month[i]
  9.         }
  10.  
  11.         diff += (b - 1)
  12.  
  13.         return dayOfWeek[diff%7]
  14.     }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top