Very entertaining puzzle.
Hint to the frustrated, as I was:
This is a "noise" exclusion problem. The 1-sigma uncertainty in the time measurement is greater than the "true" time delta between foo and goo.
The test suite method is also vey well executed.
Indeed the solution is random...
since tic toc didn't give me results, I tried the cody size approach
I tried a lot of times this solution without sucess
As did I, even with 10,000 iterations in the loop. My problem was that gamma took longer than sign did, despite the test suite saying it shouldn't. After four or five tries, I had to add an ugly hack that checked if foo was gamma.
Good to know this method does occasionally work, though...
Project Euler: Problem 8, Find largest product in a large string of numbers
Back to basics 3 - Temp Directory
Find best domino orientation
Matrix indexing with two vectors of indices
Get the elements of diagonal and antidiagonal for any m-by-n matrix
Distance walked 1D
How to add?
chance in percent for minimum K heads when a good coin is tossed N times?
Volume of this donut
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office