Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Cleared solution in Clear category for The Most Frequent Weekdays by takimoto0223
f={1:'Monday',2:'Tuesday',3:'Wednesday',
4:'Thursday',5:'Friday',6:'Saturday',0:'Sunday'}
def most_frequent_days(a):
uru=(a-1)//4-(a-1)//100+((a-1)//100)//4
Ms=((a-1)*365+uru+1)%7
if a%4==0 and a%100!=0:
Me=(Ms+1)%7
if Ms==0:
ans=[f[Me],f[Ms]]
else:
ans=[f[Ms],f[Me]]
elif a%400!=0 and a%100==0:
Me=Ms
ans=[f[Ms]]
else:
Me=Ms
ans=[f[Ms]]
return ans
June 5, 2020