Skip to content

Commit e6a13e9

Browse files
committed
ts-3: align remove-kth-last-node with canonical solution with assumed constraints on input
1 parent 539d2ed commit e6a13e9

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

typescript/Linked Lists/remove_kth_last_node.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ type LLNode = ListNode | null;
1111
*/
1212

1313
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;
1714
// A dummy node to ensure there's a node before 'head' in case we
1815
// need to remove the head node.
1916
let dummy: LLNode = new ListNode(-1);

0 commit comments

Comments
 (0)