Insert an element before or after another element in a list
The key of the list.
Whether to insert the element before or after pivot.
The element to insert before or after.
The element to insert.
The list length after insertion, 0
when the list doesn’t exist or -1
when pivot was not found.