Remove len - B th node from starting
var diff = len - B ; var prev = null ; var curr = head ; for ( i = 0 ; i < diff ; i ++ ) { prev = curr ; curr = curr . next ; } prev . next = curr . next ; return head ; } }