[IBM] OA 2025 Start – 06 Feb (Generic)

Question 2

In the context of data analysis and machine learning, a dataset containing an array of integers has been provided. Each integer is denoted as arr[i] (0 ≤ i < n). The task in this data-centric domain is to predict the kth smallest positive integer that is not found within the dataset, arr.

Note: The smallest positive integer is 1.

Example

n = 5
arr = [1, 4, 7, 3, 4]
k = 5

The first five missing positive integers are [2, 5, 6, 8, 9].
The 5th smallest positive integer not in the dataset is 9.


Function Description

Complete the function findMissingInteger in the editor below.

findMissingInteger

Parameters:

  • int arr[n]: a machine learning dataset
  • long k: find the kth smallest positive integer that is not present in the dataset.

Returns:

  • long: the kth smallest positive integer that is not in the dataset.

Constraints:

  • 1 ≤ n ≤ 2 * 10^5
  • 1 ≤ arr[i] ≤ 10^9

我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *