package arrays;
public class ImpQuestion1 {
public static void main(String[] args) {
int arr[] = {1,3,4,6};
MissingTwoElements(arr);
}
public static void MissingTwoElements(int [] arr )
{
int n = arr.length;
int brr[] = new int[n+2];
for(int j=0;j<n+2;j++)
{
brr[j] = j+1;
}
int i=0 , count = 0 , low = 0 ;
while (i<n&&count<2)
{
if(arr[i]==brr[low]) {
low++;
}
else
{
count++;
System.out.println(brr[low]);
low++;
i--;
}
i++;
}
}
}