Example 1:
Input Format:
arr[] = {2,2,1}
Result:
1
Explanation:
In this array, only the element 1 appear once and so it is the answer.
Example 2:
Input Format:
arr[] = {4,1,2,1,2}
Result:
4
Explanation:
In this array, only element 4 appear once and the other elements appear twice. So, 4 is the answer.
Hey @Chirag-v09 I want to contribute in Hactoberfest2024. If you find this problem useful please add a tag to it and assign me the same. I will be solving this problem in java.
Problem Explanation: -
Example 1: Input Format: arr[] = {2,2,1} Result: 1 Explanation: In this array, only the element 1 appear once and so it is the answer.
Example 2: Input Format: arr[] = {4,1,2,1,2} Result: 4 Explanation: In this array, only element 4 appear once and the other elements appear twice. So, 4 is the answer.
Hey @Chirag-v09 I want to contribute in Hactoberfest2024. If you find this problem useful please add a tag to it and assign me the same. I will be solving this problem in java.