First, the dates when Anne had written in her diary can be sorted, although it is not necessary within the given constraint. One way to represent the date is to use a 8-digit integer where:

  1. The most significant four digits indicate the year.

  2. Then, the next two significant digits indicate the month.

  3. The last two digits indicate the day.

Albeit, the dates can be sorted using custom comparators as well.

For each query, it is sufficient to perform a linear search, but the search can be made faster using Binary Search as well.

Statistics

73% Solution Ratio
BigBagEarliest, Apr '21
TurinhstuFastest, 0.0s
BigBagLightest, 131 kB
anonyo.akandShortest, 291B
Toph uses cookies. By continuing you agree to our Cookie Policy.