25 Horses | Amazon Interview

You have 25 horses. When they race, each horse runs at a different, constant pace. A horse will always run at the same pace no matter how many times it races.You want to figure out which are your 3 fastest horses. You are allowed to race at most 5 horses against each other at a time. You don’t have a stopwatch so all you can learn from each race is which order the horses finish in.

What is the least number of races you can conduct to figure out which 3 horses are fastest?

Leave a Reply

Your email address will not be published. Required fields are marked *

For Inserting code :
Paste your code in the comment form, select it and then click the language link

C | C++ | Java |

*