Amazon Interview Question

coding top k frequent elements