Remove Nth Node From End of List
Last updated
Was this helpful?
Last updated
Was this helpful?
Bog'langan ro'yxatning head
i berilgan, ro'yxat oxiridan n-tugunni
olib tashlang va head
ni qaytaring.
Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5]
Input: head = [1], n = 1 Output: []
Input: head = [1,2], n = 1 Output: [1]
Ro'yxatdagi tugunlar soni sz
.
1 <= sz <= 30
0 <= Node.val <= 100
1 <= n <= sz
Follow up: Buni bir o'tishda amalga oshira olasizmi?
© Leetcode