Question d’entretien chez Tencent

I did in python, biggest K elements