We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 539d2ed commit e6a13e9Copy full SHA for e6a13e9
typescript/Linked Lists/remove_kth_last_node.ts
@@ -11,9 +11,6 @@ type LLNode = ListNode | null;
11
*/
12
13
function removeKthLastNode(head: LLNode, k: number): LLNode {
14
- // If k is less than or equal to 0, no node needs to be removed.
15
- if (k <= 0)
16
- return head;
17
// A dummy node to ensure there's a node before 'head' in case we
18
// need to remove the head node.
19
let dummy: LLNode = new ListNode(-1);
0 commit comments