I realised that the API given by toptal for this exercise could be improved.
The toptal API is a more out of date imperative look at APIs, where a crossing count is given as just a number, which one could argue is fine for this - the API should give the the path count of the first crossing, and so no crossing would give a count of zero.
However, a more modern functional look at the world states that either a cross took place or it did not. If a crossing did take place, then give that path count, otherwise indicate that no crossing took place by using a monad, in this case a Scala None.