Video courses for company/skill based Preparation
Purchase mock tests for company/skill building
Finding repeating elements in an array using Python
Repeating elements in an array using Python
Repeating elements are the elements which appear more than once in an array. In this program we will find such elements in an array using python. Initially we will find the occurrence of each element, if the occurrence is more than once then the element is termed as repeating element.
- Example : Consider the array elements 3,7,9,3,5,2,1,3,5
- The elements with more than one occurrence are 3,5
- The repeating elements are 3,5
- Input the elements of an array
- Iterate through the elements of an array and find the count of each element.
- If count of an element is greater than 1,then append them to a new array
- The new array is nothing but repeating element array.
- Display new array