func?solution(_A : [Int],_X :Int) ->Int{
? ? ? ? var?dic =Dictionary ()
? ? ? ? var?index :Int=0
? ? ? ? for?num?in?A {
? ? ? ? ? ? dic[num] =1
? ? ? ? ? ? if(dic.count== X) {
? ? ? ? ? ? ? ? return?index
? ? ? ? ? ? }
? ? ? ? ? ? index +=1
? ? ? ? }
? ? ? ? return?-1
? ? }