You are given a sorted array arr[] of distinct integers in non-decreasing order and an integer k, return true if k is present in the array, otherwise false.
Note: If multiple occurrences are there, please return the smallest index.
Topics
Companies
Articles
Examples:
Expected Time Complexity: O(log n)
Expected Auxiliary Space: O(log n)
Constraints:
1 <= arr.size() <= 10^5
1 <= arr[i] <= 10^6
1 <= k <= 10^6
Companies:
OracleTCSAccentureInfosysCognizant + 1 more
Topics:
ArraySorting Algorithms
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.