Find a subsequence with fastest time for specific distance
You cannot generally get time for exactly $100$ meters with this data. The better approach would be to search for the longest run within some multiple of $2$ seconds.

Find the longest distance run in $2\cdot k$ seconds:  


Set desired k.
Set i = 0 and j = k-1.
Set currentSum = maxSum = totalMeters[j].
While j &lt; totalMeters.length - 1 do


i++; j++;
currentSum = totalMeters[j] - totalMeters[i]
if currentSum &gt; maxSum then maxSum = currentSum



This should also give you an idea how to build other similar algorithms for this problem, if you don't change your approach.