I have a linked list of Option<Box<ListNode>>
type, a node of this list contains two properties: value (i32) and next (Option<Box<ListNode>>
). I’ve created a vector of pointers (Vec<&Box<ListNode>>
) with the purpose of serving to modify the original list as showed in the following picture:
Note: the resulting list should be: L: 1 -> 2 -> n-1 -> n
how to get it?