Aryan PrajapatKnowledge Contributor
Given an array of non-duplicating numbers from 1 to n where one number is missing, write an efficient java program to find that missing number.
Given an array of non-duplicating numbers from 1 to n where one number is missing, write an efficient java program to find that missing number.
Input: arr[] = {1, 2, 4, 6, 3, 7, 8}, N = 8
Output: 5
Explanation: The missing number between 1 to 8 is 5