added solution for top k