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.
例如,我有 1D 数组,我想在数组中找到 k max 个元素并返回它们的值和\或索引,我该怎么做?
使用sort(), 然后取k结果的第一个元素。
sort()
k