Skip to content

Sunday Times Teaser 3325 – Olive and Don

by BRG on 14 June 2026

Olive lives at the southwest corner of a city with a grid of streets (as shown with north at the top). She wants to visit her father Don, who lives at the northeast corner. Olive is trying to work out how many possible routes she can use along the streets, not visiting any intersection more than once, but thinks that there are too many to count. To make the calculation easier, she has decided that she  will only travel in the following directions: NW, N, NE, E or SE.

She tells Don the number of possible routes, and he works out that the number is the product of their ages (both of which have two digits).

How old are Olive and Don?

From → Uncategorized

3 Comments Leave one →
  1. BRG permalink

    • John Z permalink

      Excellent!
      It would be slightly more efficient to write line 9 as:

      yield 1

      and rewrite line 18 accordingly.

  2. Frits permalink

    I only coded this to do something slightly different (using Brian’s slicing method).
    It is probably more efficient for bigger grids.

Leave a Reply

Note: HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS