class Solution:
    def foundOnceNumber(self , arr , k ):
        # write code here
        b = sorted(arr)
        i = 0
        while i <len(b)-1:
            if b[i] == b[i+1]:
                i += k
            else:
                return b[i]
        return b[-1]