Complete the code to initialize the slow pointer to the head of the linked list.
let mut slow = [1];The slow pointer starts at the head of the linked list to begin traversal.
Complete the code to move the fast pointer two steps ahead safely.
[1]This safely moves the fast pointer two steps ahead using Rust's Option chaining.
Fix the error in the loop condition to check if fast and fast.next are not None.
while fast.is_some() && [1] {
We must check if fast's next node exists by unwrapping fast safely.
Fill both blanks to move slow by one step and fast by two steps safely.
slow = [1]; fast = [2];
Slow moves one step using Option chaining; fast moves two steps similarly.
Fill all three blanks to return true if slow equals fast, else false after loop.
if slow == [1] { return [2]; } return [3];
If slow and fast meet, a cycle exists (return true). Otherwise, return false.
