Solved LeetCode program · 870 of 1,000
#1185 · Day of the Week
Original English source
The day is 31. The month is 8. The year is 2019.
If month is less than 3.
Increase month by 12. Decrease year by 1.
The century is year divided by 100. The short is year modulo 100. The step is (13 times (month plus 1)) divided by 5. The index is day plus step plus short plus (short divided by 4) plus (century divided by 4) plus (5 times century). Set index to index modulo 7.
The names is a list of "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", and "Friday".
Show item index of names.
Expected stdout
Saturday