Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我被问到这个问题。我尝试使用多数元素方法,但它对我不起作用。请提供一些提示。
O(n)
总时间为3*O(n)=O(n)。 希望这可以帮助 :)
3*O(n)=O(n)