arr = [7, 4, 5, 0, 7, 8, 0, 3, 2]
      arr_size = len(arr)
      for i in range(arr_size):
          x = arr[i] % arr_size
          arr[x] = arr[x] + arr_size
      print("The repeating elements are : ")
      for i in range(arr_size):
          if (arr[i] >= arr_size*2):
              print(i, " ")
      
      Python language logo

      Duplicate Elements

      Find out and print duplicate elements in an array

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.