<t>There are 5 gas stations in one round circle, which has one way street(such as 5->4->3->2->1->5). Suppose you know the distance between adjacent stations and how many miles you can go with the gas you get from each station. Question: find which station you should start from so you can make one ci...
<t>Jan, thanks for your detailed explanation, it is really helpful. I searched your book on amazon.com and it is a very interesting book. But I am a poor PhD student looking for a quant job, may not be able to buy it at this time In your guys' opinion, what's the best book for Linear Algebra? It see...
Is it possible for a large number of random variables (say 500) to have negative correlation between each other? That is: COV(Xi, Xj) < 0 for any i != j, i, j = 1,2,...,500. If yes or no, how and why? Thanks.
Well, the method you mentioned should be the best way to search multiple missing numbers, however, it takes extra storage too. What if we don't have extra storage for bitset?
rblaser, your answer is pretty good, one question is, is it really better off to solve two equations with two variables than just use an extra table to mark if each number appears in the array or not? i guess solving equations costs lots of time.
<t>Actually this one comes along with another problem: Suppose we have 99 distinct integers from 1 to 100. What is the best way to find out the other two missing integers (within [1, 100])? Solution: just sum these 99 numbers and subtract it from sum(1,2,...,100).So is it possible to get 2 missing n...