Find the time $t_{s,max}$ with the maximum selling price (if there is a tie, take the latest point in time). Find the lowest buying price up to and including $t_{s,max}$. Buying at that lowest price and selling at the selling price of time $t_{s,max}$ is your first candidate transaction.
Now remove all buy/sell info at and before time $t_{s,max}$ and start this algorithm again. This will produce more candidate transactions, but will eventually finish as at least one line of buy/sell info is removed in each step. Take the transaction from the candidates that has the most profit (or don't do anything if that maximum profit turns out to be negative).
Then jump into your time machine and actually execute the transactions ;-)
In your example (if we assume it stops after line 101 99), $t_{s,max}$ would be step 4, the lowest buying price at or before that time is 100, so the first candidate becomes "buy for 100 at timestep 2 and sell for 102 at timestep 4".
After removing all data at and before timestep 4, we are left with only one more line, which becomes the next candidate: "buy for 101 at timestep 5 and sell for 99 at timestep 5".
After this, the algorithm ends as there is no mor buy sell info. So among the 2 candidates, the first one is the best.