If anyone was able to solve this question…
Problem Link: Make K Most Frequent Practice Coding Problem