-8

Example 1: input: [1,3,2,1,3,5]

Output: [1,3]

def duplicateNumber(mylist):
??

Thanks

AmadeusNing
  • 107
  • 5
  • 16

1 Answers1

0

Next time at least make an honest effort, describe the problem you are facing and then ask a question :

 def duplicateNumber(x): 
        _size = len(x) 
        repeated = [] 
        for i in range(_size): 
            k = i + 1
            for j in range(k, _size): 
                if x[i] == x[j] and x[i] not in repeated: 
                    repeated.append(x[i]) 
        return repeated 
Ravish Jha
  • 481
  • 3
  • 25