Getting wrong answer

approach:
1:- made a hashTable of element,freq
2:-pushed element,freq pair from HT in a new priority_queue ( max heap for freq (p.second) ) for every iteration
3:- popped till k or while not pq empty and printed them

hi @tusharbajaj200153_02bc6c0c5583c81d,
newline after each test case missing

1 Like