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
dayis one of the seven names, capitalised as above.- 0 <= n <= 10^9
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 8. ⌘Enter runs, ⌘⇧Enter submits.