Question d’entretien chez Viasat

How to find duplicates in an array?

Réponse à la question d'entretien

Utilisateur anonyme

9 mars 2017

x = "Raviteja" x1 = list(x) y = {} for i in x1: if i in y: y[i] +=1 else: y[i] = 1 for i,j in y.items(): if j >1: print "Duplicate is %s and %s" (i,j)