https://replit.com/@CrabBucket1/OutgoingElatedSlash#main.rs Trying to do a relatively easy leetcode problem but Im running into trouble with Box pointer (given in the datastructure from leetcode) https://i.imgur.com/NjkM0gK.png
The struct looks liek this
pub val: i32,
pub next: Option<Box<ListNode>>
}```
I want to create a Box pointer to the first ListNode like `let result = Box::new(ListNode::new(0))` the inside the loop I want to update the correct value based on the function inputs until both `Option<Box<ListNode>>` are none and I always seem to get borrow issues one or the other depending on different attempts at implementing.
The LeetCode Problem:
https://leetcode.com/problems/add-two-numbers/
Any advice would be appreciated (Also here is a valid solution to the problem that doesn't mutate already allocated nodes: https://levelup.gitconnected.com/leetcode-problems-add-two-numbers-6a4045ce146c