gpt4 book ai didi

c++ - 如何在数组中找到两个缺失值?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:46:55 27 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Easy interview question got harder: given numbers 1..100, find the missing number(s)

求职面试问题。假设我们有一个大小为 N-2 的数组,其中包含从 1 到 N 的所有值,除了两个缺失值。 (N>0)

需要一种算法来找到两个缺失的数字,该算法只遍历数组一次。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com