Find duplicate in an array of N+1 Integers in Python
One Subscription, For Everything
The new cool way of learning and upskilling -
One Subscription access everything
Get Access to PrepInsta Prime
from FAANG/IITs/TOP MNC's
PrepInstaPrime
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.
Login/Signup to comment
a=[-1, 8, 1, 8, -1, 5, 1, -3]
a.sort()
d=[]
s=[]
for i in a:
if i not in d:
d.append(i)
else:
s.append(i)
print(s)