<p>几个月前,我在纽约采访了一家对冲基金公司,不幸的是,我没有得到作为数据/软件工程师的实习机会。(他们还要求解决方案使用Python)</p>
<p>我在第一个面试问题上搞砸了。。。</p>
<blockquote>
<p>Question: Given a string of a million numbers (Pi for example), write
a function/program that returns all repeating 3 digit numbers and number of
repetition greater than 1</p>
</blockquote>
<p>例如:如果字符串是:<code>123412345123456</code>,则函数/程序将返回:</p>
<pre><code>123 - 3 times
234 - 3 times
345 - 2 times
</code></pre>
<p>在我面试失败后,他们没有给我解决方案,但他们告诉我,解决方案的时间复杂度恒定为1000,因为所有可能的结果都在以下之间:</p>
<p>000-->;999</p>
<p>现在我在想,我不认为有可能想出一个恒定时间的算法。它是?</p>