Kth Missing Positive Number in a Sorted Array | GeeksForGeeks | Problem of the Day | Python | C++

Описание к видео Kth Missing Positive Number in a Sorted Array | GeeksForGeeks | Problem of the Day | Python | C++

Given a sorted array of distinct positive integers arr[], we need to find the kth positive number that is missing from arr[].

Examples :

Input: arr[] = [2, 3, 4, 7, 11], k = 5
Output: 9
Explanation: Missing are 1, 5, 6, 8, 9, 10… and 5th missing number is 9.
Input: arr[] = [1, 2, 3], k = 2
Output: 5
Explanation: Missing are 4, 5, 6… and 2nd missing number is 5.
Input: arr[] = [3, 5, 9, 10, 11, 12], k = 2
Output: 2
Explanation: Missing are 1, 2, 4, 5, 6… and 2nd missing number is 2.

#geeksforgeeks
#problemoftheday
#education
#computerscience
#coding
#array
#sorting
#sorts
#sort
#datastructure
#algorithmicproblemsolving
#algorithms
#algorithm
#dynamicprogramming
#dp
#potd
#gfg
#binarytree
#binarysearchtree
#bst
#string
#dictionary
#python
#stack
#queue
#python
#c++
#interview
Table of Contents
0:00 Problem Statement
0:30 Solution
8:09 Pseudo Code
9:27 Code - Python
10:06 Code - C++

Комментарии

Информация по комментариям в разработке