Solved
Find missing element in an array.
Given an array of size N-1 such that it only contains distinct integers in the range of 1 to N. Find the missing element.
Example 1:
Input:
N = 5
A[] = {1,2,3,5}
Output: 4
Given an array of size N-1 such that it only contains distinct integers in the range of 1 to N. Find the missing element.
Example 1:
Input:
N = 5
A[] = {1,2,3,5}
Output: 4
a!localVariables(
local!list: {1,2,3,5},
difference(1 + enumerate(max(local!list)), local!list)
)Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.