First2 solution in Clear category for The Most Frequent Weekdays by tigerhu3180
from datetime import date
List of most frequent days of the week in the given year
#the start day and the end day of year is 'xxxday'?
#build a bridge from 'start' to 'Sunday' same as 'Monday' to 'end'
#find which day occured most,then that could be answer
list1=[i for i in range(start,7)]
list2=[i for i in range(end+1)]
#return common or put both list together when no common
return [DAY[i] for i in list1 if i in list2] or sorted([DAY[i] for i in list1+list2])
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert most_frequent_days(2399) == ['Friday'], "1st example"
assert most_frequent_days(1152) == ['Tuesday', 'Wednesday'], "2nd example"
assert most_frequent_days(56) == ['Saturday', 'Sunday'], "3rd example"
assert most_frequent_days(2909) == ['Tuesday'], "4th example"
March 8, 2018