You don't want the shortest time, you want the shortest guaranteed time.
... and it's missing a detail like that which could impact your prospects.
I'm not a big fan of abstract math puzzles in interviews for that reason. It's too easy for a candidate to miss key details or indeed the entire point of the question. It's hard to compare candidates when one does the binary search answer and correctly ignores all the irrelevant engineering/technical aspects in favour of the logic puzzle, another tries to do that but gets one word wrong so their answer is incorrect, while another treats it as a real-world problem like Fgrir did and says "hand it to a technician", and that's before you even get into the engineering answers.
My habit is to test the actual skills that I want, and let the managers do whatever makes them happy. Give me a set of candidates and I will put each through the same set of practical tests, carefully noting both their ability to solve the problems and how they talked me through what they did, as well as what questions they asked. Most of what I do is computerised so that's pretty easy, but I have also seen technicians subjected to "assemble this kit" type tests where they had to make the LED blink and then modify the circuit so it blinked slower. I have a set of programming tests that run inside a virtual machine so that everyone gets the same setup, and each step starts with a fresh project so failure or divergence at one step doesn't break future steps.
In that sense my most bizarre ever interview question happened before the interview technically started. I was given an address and company name, but not the phone number of the person interviewing me. When I got to the address there was a big construction site and no sign of a building that could conceivably provide an office for me to work in. I rang the recruiter and they knew nothing, so I started walking back to the train station. As I got to the station they rang back and said "oh yes, they say everyone does that, their office is around behind the construction you have to go down the side street a few hundred metres down and ...". I got on the train. An employer who will hide information even after being made aware that it's missing is a big red flag. Admittedly in this case the employer was also unsuitable for other reasons and had gone out of their way to hide those. Second red flag. Even if I had been willing to work for them despite my misgivings, those two actions would have ruled them out.