擅长:python、mysql、java
<p>这个答案假设潮汐在给定的时间内不会出现几次。你知道吗</p>
<pre><code># Sample data
tide_list = [111, 123, 135, 143, 146, 140, 128, 113, 99]
# Filter out the low values and replace the high values with their index in the list (plus an offset)
above = [i+9 for i, level in enumerate(tide_list) if level >= 100]
# You could replace this with the error logic of your choice
assert len(above) >= 1, 'The tide never came'
# Format and print the result
print('{0:02d}:00~{1:02d}:00'.format(above[0], above[-1]))
</code></pre>