Given a linked list and integers m and n, retain m nodes and then delete n nodes, repeating this pattern across the whole list. Return the resulting list as an array. (This is the classic skip-M, delete-N traversal.) Input: '[list], m, n'.
Input: '[list], m, n'.
Output: Array — the list after the pattern.
Input: [1,2,3,4,5,6,7,8,9,10], 2, 3
Output: [1,2,6,7]
Explanation: Keep 2, delete 3, repeat.Input: [1,2,3,4,5,6,7,8,9,10], 1, 1
Output: [1,3,5,7,9]
Explanation: Keep 1, delete 1.Input: [1,2,3,4], 2, 0
Output: [1,2,3,4]
Explanation: Nothing deleted.0<=n<=10^41<=m0<=n_delete