Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

missing number in array


public class Solution 
{
    public int[] FindErrorNums(int[] nums) 
    =>nums.Concat(Enumerable.Range(1, nums.Length))
    .GroupBy(x=>x).Where(x=>x.Count()==1)
    .Select(x=>x.Key).ToArray();
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #missing #number #array
ADD COMMENT
Topic
Name
3+9 =