You are given an array arr[] of size n - 1, containing distinct integers ranging from 1 to n (inclusive), except one missing element. The task is to find and return the missing integer from the range.
Topics
Companies
Articles
Examples:
Expected Time Complexity O(N)
Expected Space Complexity O(1)
Constraints:
1 <= arr.size() <= 10^6
1 <= arr[i] <= arr.size() + 1
Companies:
AmazonMicrosoftVisaAdobeTCS + 6 more
Topics:
ArraySearching 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.