@SanjayKumar-iu7rq

Bro code is not oprimized 
Tc should be n*k
But your code has tc - n*k*logk

@thodasikho1242

Does your solution considered the case if the frequency is same

@pbme-2

this code gives tle