Given the head of a singly linked list and an integer k, return the values of every kth node (positions k, 2k, 3k, ...) in the list.
Input: Head of a singly linked list and integer k (1-based).
Output: Array of values at positions k, 2k, 3k, ...
Input: [1,2,3,4,5,6,7,8,9,10], 3
Output: [3,6,9]
Explanation: Positions 3,6,9.Input: [1,2,3,4,5], 2
Output: [2,4]
Explanation: Every 2nd node.Input: [1,2,3,4,5], 1
Output: [1,2,3,4,5]
Explanation: k=1: every node.1<=nodes<=10^5-10^9<=Node.val<=10^91<=k<=n