LeetCode solutions

1289. Day of the Week

My accepted Python solution to LeetCode problem 1289, Day of the Week, running in 0ms.

  • Difficulty: Easy
  • Python
  • Runtime 0ms
  • Memory 17.7MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 17.7MB, accepted 2025-12-30.

python
class Solution:
    def dayOfTheWeek(self, day: int, month: int, year: int) -> str:
        import datetime
        days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
        d = datetime.date(year, month, day)
        return days[d.weekday()]

Source