We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. Prepare
  2. Python
  3. Date and Time
  4. Calendar Module
  5. Discussions

Calendar Module

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • 404NameNotFound
    4 months ago+ 1 comment

    Another oneliner, (year > 2000)

    print( (lambda m, d, y: ['SATURDAY', 'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY'][int((int(d)+[0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365][int(m) - 1]-(not int(y)%4 and int(m)<3)+(int(y)-2000)*365.25)%7)])(*input().split()) )

    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy