Smallest Positive missing number - find the smallest positive number missing from the array - GfG

preview_player
Показать описание
reverse bits

Problem link :

Course link:

Hi, thanks for watching our video about Bit manipulation in C++
In this video we’ll walk you through:
- Array traversal
- efficient approach
- Solution

TIMESTAMPS
0:00 Intro
00:30 Explanation begins
06:10 IDE solution

ABOUT OUR CHANNEL
Our channel is all about Programming. We cover lots of cool stuff such as solution to problems, concept explanation and tricks to master CP
Check out our channel here:
Don’t forget to subscribe!

CHECK OUT OUR OTHER Playlists

GeeksforGeeks playlist:

Complete C++ Course playlist:

CodeChef Playlist:

LeetCode problems

HackerRank playlist:

FIND US AT

GET IN TOUCH

You are given an array arr[] of N integers including 0. The task is to find the smallest positive number missing from the array.

Example 1:

Input:
N = 5
arr[] = {1,2,3,4,5}
Output: 6
Explanation: Smallest positive missing
number is 6.
Example 2:

Input:
N = 5
arr[] = {0,-10,1,3,-20}
Output: 2
Explanation: Smallest positive missing
number is 2.
Your Task:
The task is to complete the function missingNumber() which returns the smallest positive missing number in the array.

Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).

Constraints:
1 less than equal to N less than equal to 106
-106 less than equal to arr[i] less than equal to 106



Company Tags
Accolite Amazon Samsung Snapdeal
Topic Tags
Arrays Searching
Related Courses
DSA-Self Paced with Doubt Assistance Data Structures and Algorithms Placement 100 Complete Interview Preparation Complete Interview Preparation With Doubt Assistance Wipro ENTH Preparation Live Classes on Data Structures & Algorithms - USA Geeks Classes - Live Session Advance DSA Course Competitive Programming - Live
Related Interview Experiences
Amazon interview experience set 264 experienced for sde1 Samsung interview experience set 21 campus Snapdeal interview experience set 17 sdet Amazon interview experience 220 on campus Accolite interview experience set 4 on campus
Рекомендации по теме
Комментарии
Автор

jab aaata nehi hai ...kyu dusro ka time barbaad karte hoo...O(1) space required .

RAHULROY-sbnt
Автор

Phele question ache se pad le O(1) space mai chiye answer ..time waste kar diya pura

sonumehra
join shbcf.ru