2.
Write a program to remove all duplicate numbers in the given integer array and create a new array and print the new array:
eg:
Input Array {1, 2, 3, 1, 2, 5, 6, 8, 8, 1, 7, 7}
Output: 1, 2, 3, 5, 6, 8, 7
Save
Type the Program here.
32
Next >
Last >>
< Previous
©2017 Vyshnavi Information Technologies (India) Pvt. Ltd, 5th floor, Janardhan Towers, Residency Road, Bangalore-560 025
Answers
Answered by
0
Answer
Initialize array
arr = [1, 2, 3, 4, 2, 7, 8, 8, 3];
print("Duplicate elements in given array: ");
#Searches for duplicate element
for i in range(0, len(arr)):
for j in range(i+1, len(arr)):
if(arr[i] == arr[j]):
print(arr[j]);
hope this helps!!
please make it as brainlist!!!!
Similar questions
Hindi,
2 months ago
Physics,
2 months ago
Math,
2 months ago
Social Sciences,
4 months ago
Math,
4 months ago
Math,
10 months ago
Science,
10 months ago
Social Sciences,
10 months ago