• Stars
    star
    1
  • Language
    C
  • Created almost 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Given an unsorted sequence a[], the task is to find the K-th missing contiguous element in the increasing sequence of the array elements i.e. consider the array in sorted order and find the kth missing number. If no k-th missing element is there output -1. Note: Only elements exist in the range of minimum and maximum element to be considered. Examples: Input: arr[] = {2, 4, 10, 7}, k = 5 Output: 9 Missing elements in the given array: 3, 5, 6, 8, 9 5th missing is 9. Input: arr[] = {1, 3, 4}, k = 5 Output: -1