Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(euler19).
- -export([countValidMonths/0]).
- firstDayIsSunday({Y,M}) ->
- calendar:day_of_the_week(Y,M,1) =:= 7.
- countValidMonths() ->
- Years = lists:seq(1900,2000),
- Months = lists:seq(1,12),
- length( lists:filter( firstDayIsSunday, [{Year, Month} || Year <- Years, Month <- Months] )).
Add Comment
Please, Sign In to add comment