Write code for printing duplicate numbers in a list.
AnswerBot
1y
Code to print duplicate numbers in a list.
Iterate through the list and keep track of the count of each number using a dictionary.
Print the numbers that have a count greater than 1.
Praveen S Kotagunasi
1mo
Given a list of integers with duplicate elements in it. The task is to generate another list, which contains only the duplicate elements. In simple words, the new list should contain elements that app...read more
Chavhan Vijay
1y
A= [1, 2, 3, 4, 2, 7, 8, 8, 3];
print("Duplicate elements are: ");
#Searches for duplicate element
for i in range(0, len(A)):
for j in range(i+1, len(A)):
if(A[i] == A[j]):
print(A[j]);
Comment deleted
Add answer anonymously...
Top EPAM Systems Data Engineer interview questions & answers
Popular interview questions of Data Engineer
Top HR questions asked in EPAM Systems Data Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app