added solution for kth element of a list