Challenge 7: Find First Unique Integer in an Array

"Unique" means the number does not repeat and appears only once in the whole array. Implement the optimized solution in C# and see if it runs correctly.

Problem statement

Implement a function, findFirstUnique(int[] arr, int size), which takes an array and its size as input and returns the first unique integer in the array. The function returns -1 if no unique number is found.


This is an array of integers and its size


This is the first unique element in the array

Sample input


Sample output


Level up your interview prep. Join Educative to access 80+ hands-on prep courses.