yurongzhen
BAN USER
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
@Sudhindra: He already assumed that after 6th race, A1 > B1>...E1.
- yurongzhen December 20, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
Your approach can find the correct top 3 but is not the optimal one, because you didn't fully utilize the inequality information out of the first 5 races.
- yurongzhen December 20, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
This is a partition sort problem. You won't be able to know the relative speeds of 1 to 9 after R2, because you don't have a stopwatch, and the only information you obtain after each race is the inequality chain.
In your R2, for example you pick #1 in R1, even if #1 tops in R2, it could be #1<#6<#7<#8<#9<#2<#3<#4<#5, it also could be #1<#6<#7<#2<#8<#3<#9<#4<#5
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
In your 7th round, you only need to race the second fastest in 6th round and the second fastest to the best one of 25 horses which was noted in one of the first 5 rounds.
- yurongzhen December 20, 2012