Copyright © University of Cambridge. All rights reserved.
'Counting Binary Ops' printed from https://nrich.maths.org/
The underlying structure of this problem is very similar to
Walkabout. The teachers' notes to Walkabout suggest a possible
approach which would work here too.