Skip to content
Onsite

Day of the Week After N Days

EasyP3Coding

day is a weekday name from "Monday" to "Sunday" (week order, Monday first). Return the name of the weekday that falls n days after it. n = 0 returns the same day.

Example 1

Input
day = "Monday", n = 3
Output
"Thursday"

Example 2

Input
day = "Sunday", n = 1
Output
"Monday"

Example 3

Input
day = "Friday", n = 0
Output
"Friday"

Constraints

  • day is one of the seven names, capitalised as above.
  • 0 <= n <= 10^9

Hints

Run checks the 3 visible tests, Submit all 8.