2024-05-07 08:12:03 +02:00
|
|
|
# Instructions
|
|
|
|
|
|
2024-06-04 14:20:24 +02:00
|
|
|
Your task is to find the exact date of a meetup, given a month, year, weekday and week.
|
2024-05-07 08:12:03 +02:00
|
|
|
|
2025-07-15 07:50:26 -04:00
|
|
|
There are six week values to consider: `first`, `second`, `third`, `fourth`, `last`, `teenth`.
|
2024-06-04 14:20:24 +02:00
|
|
|
|
|
|
|
|
For example, you might be asked to find the date for the meetup on the first Monday in January 2018 (January 1, 2018).
|
2024-05-07 08:12:03 +02:00
|
|
|
|
|
|
|
|
Similarly, you might be asked to find:
|
|
|
|
|
|
|
|
|
|
- the third Tuesday of August 2019 (August 20, 2019)
|
|
|
|
|
- the teenth Wednesday of May 2020 (May 13, 2020)
|
|
|
|
|
- the fourth Sunday of July 2021 (July 25, 2021)
|
|
|
|
|
- the last Thursday of November 2022 (November 24, 2022)
|
2024-06-04 14:20:24 +02:00
|
|
|
- the teenth Saturday of August 1953 (August 15, 1953)
|
2024-05-07 08:12:03 +02:00
|
|
|
|
2024-06-04 14:20:24 +02:00
|
|
|
## Teenth
|
2024-05-07 08:12:03 +02:00
|
|
|
|
2024-06-04 14:20:24 +02:00
|
|
|
The teenth week refers to the seven days in a month that end in '-teenth' (13th, 14th, 15th, 16th, 17th, 18th and 19th).
|
2024-05-07 08:12:03 +02:00
|
|
|
|
2024-06-04 14:20:24 +02:00
|
|
|
If asked to find the teenth Saturday of August, 1953, we check its calendar:
|
2024-05-07 08:12:03 +02:00
|
|
|
|
|
|
|
|
```plaintext
|
|
|
|
|
August 1953
|
|
|
|
|
Su Mo Tu We Th Fr Sa
|
|
|
|
|
1
|
|
|
|
|
2 3 4 5 6 7 8
|
|
|
|
|
9 10 11 12 13 14 15
|
|
|
|
|
16 17 18 19 20 21 22
|
|
|
|
|
23 24 25 26 27 28 29
|
|
|
|
|
30 31
|
|
|
|
|
```
|
|
|
|
|
|
2024-06-04 14:20:24 +02:00
|
|
|
From this we find that the teenth Saturday is August 15, 1953.
|