Count Array Element
2026/3/9小于 1 分钟
Count Array Element
题面
统计 32 位整数数组中等于给定整数 k 的元素个数,结果写入 output。
Implementation Requirements
- Use only native features (external libraries are not permitted)
- The solve function signature must remain unchanged
- 结果写入
output
Examples
Input: [1, 2, 3, 4, 1], k=1 → 2
Input: [5, 10, 5, 2], k=11 → 0Constraints
- 1 ≤ N ≤ 100,000,000
- 1 ≤ input[i], k ≤ 100,000
- Performance: K = 501,010, N = 100,000,000