FunctionRacerProblemsRace

Friday the 13th Count

MediumMathPython, JavaScript, TypeScript, Java, C++

Return how many months of the given year have a 13th that falls on a Friday. Use the Gregorian calendar. Known anchor: January 1, 2000 was a Saturday.

Example 1

year 2015
returns 3

February, March and November 2015.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems