Given a sorted array with possibly duplicate elements, the task is to find indexes of first occurrences of an element x in the given sorted array in O(log(n)) times
Input: {2, 5, 5, 5, 6, 6, 8, 9, 9, 9} target = 5
Output: 1
Input: {2,2,3,3,3,3,3,5,5,5,6,7,7,8} target =2
Output: 0
*****************************
Difficulty: Medium
Topic: Searching Algorithm
DS: Array | 2 pointer
Company: MNC
*****************************
►Code: https://bit.ly/2EsaKVT
► Buy me a Coffee:☕ ☕ ☕ https://www.buymeacoffee.com/techanindya
[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 first occurrence of a number in a sorted array in log(n) time
►**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: / anindya-sankar-dasgupta-39a315ba
Facebook: / anindya.s.dasgupta
Instagram: / anindya_bunny
Medium: https://bit.ly/3loMzsa
FB page: / technicalinterview03
Telegram: https://t.me/TechnicalInterview_official