Given a sorted array of n distinct integers where each integer is in the range from 0 to m-1 and m greater than n. Find the smallest number that is missing from the array.
Input: {0, 1, 2, 3}
Output: 4
Input: {0, 1, 2, 3, 4, 5, 6, 7, 10}
Output: 8
*****************************
Difficulty: Medium
Topic: Searching Algorithm
DS: Array | 2 pointer
Company: FAANG
*****************************
Code: https://bit.ly/2XEFoSz
[IMPORTANT]
Complete List of interview questions that you need to prepare: https://bit.ly/34HXbMI
In this video we will see how to how to find the smallest missing number in a sorted array in O(log n)
**This video comes under "MEDIUM" section of interview questions.
Q1: Find duplicate element in a given array:
Q2: Separate odds and even numbers in a given array:
Q3: Segregate 0's 1's and 2's in an array:
Q4: First occurrence of a number in a sorted array:
Q5: Trapping Rain Water Problem:
Q6:Smallest Missing Number in sorted array:
Q7: Zero Sum Subarray Problem:
Q8: Number of rotation in a circular sorted array:
Q9:First non repeating character in a string:
Q10: Longest Substring Without Repeating Characters:
Q11: Find Triplets In Array With Given Sum:
Q12: Max Contiguous Subarray Sum ( Kadane's Algo ):
#interviewWithBunny #codinginterview #crackingthetechnicalinterview
Social Connect:
LinkedIn: https://www.linkedin.com/in/anindya-sankar-dasgupta-39a315ba/
Facebook: https://www.facebook.com/anindya.s.dasgupta
Instagram: https://www.instagram.com/anindya_bunny/
Medium: https://bit.ly/3loMzsa
FB page: https://www.facebook.com/technicalinterview03/
Telegram: https://t.me/TechnicalInterview_official