Question: You are given an integer array arr [ ] of size n , representing n number of people in a party, each person is denoted

You are given an integer array arr[] of size n, representing n number of people in a party, each person is denoted by an integer. Couples are represented by the same number ie: two people have the same integer value; it means they are a couple. Find out the only single person in the party of couples.
NOTE: It is guaranteed that there exists only one single person at the party.
Example 1:
Input:
n=5
arr ={1,2,3,2,1}
Output:
3
Explaination: Only the number 3 is single.
Example 2:
Input:
n=11
arr={1,2,3,5,3,2,1,4,5,6,6}
Output:
4
Explaination: 4 is the only single.
give code in python language.
You are given an integer array arr [ ] of size n

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!