设备中存有 n
个文件,文件 id
记于数组 documents
。若文件 id
相同,则定义为该文件存在副本。请返回任一存在副本的文件 id
。
示例 1:
输入:documents = [2, 5, 3, 0, 5, 0] 输出:0 或 5
提示:
0 ≤ documents[i] ≤ n-1
2 <= n <= 100000
版本:clang 19
采用最新 C++ 23 标准,并使用 GCC 14 提供的 libstdc++
。
编译时,将会采用 -O2
级优化,并提供 -gline-tables-only
参数。AddressSanitizer 也被开启来检测 out-of-bounds
和 use-after-free
错误。
为了使用方便,大部分标准库的头文件已经被自动导入。