maxValBox[0] = tree.val
]]>
Node* RemoveNodesWithValue(Node* head, int k) {
if (!head) {
return head;
}
Node dummy;
dummy.next = head;
Node* prev = &dummy;
Node* current = head;
while (current) {
if (current->data == k) {
prev->next = current->next;
delete current;
current = prev->next;
}
else {
prev = current;
current = current->next;
}
}
return dummy.next;
}
I wonder if it would be possible to keep only the index number of failing string compared to original one in the cache instead of whole substring. For your example, it would cache the string tuple as {bc,f}, for some time rigth? Instead, would it be possible to cache {1,2} meaning that 1 is the substring of abc from the index 1 and so on.
]]>