Pergunta de entrevista da empresa Viasat

How to find duplicates in an array?

Resposta da entrevista

Sigiloso

9 de mar. de 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)