Rust  2Pointers and Output to Array 0ms Solution
2Pointers\n\n// Definition for singly-linked list.\n// #[derive(PartialEq, Eq, Clone, Debug)]\n// pub struct ListNode {\n//   pub val: i32,\n//   pub next: Opti
### 2Pointers\n```\n// Definition for singly-linked list.\n// #[derive(PartialEq, Eq, Clone, Debug)]\n// pub struct ListNode {\n//   pub val: i32,\n//   pub next: Option<Box<ListNode>>\n// }\n// \n// impl ListNode {\n//   #[inline]\n//   fn new(val: i32) -> Self {\n//     ListNode {\n//       next: None,\n//       val\n//     }\n//   }\n// }\nimpl Solution {\n    pub fn middle_node(head: Option<Box<ListNode>>) -> Option<Box<ListNode>> {\n        let mut fast_p = &head;\n        let mut slow_p = &head;\n        \n        while fast_p.is_some() && fast_p.as_ref().unwrap().next.is_some() {\n            slow_p = &slow_p.as_ref().unwrap().next;\n            fast_p = &fast_p.as_ref().unwrap().next.as_ref().unwrap().next;\n        }\n        slow_p.clone()\n    }\n}\n```\n\n### Output to Array\n```\n// Definition for singly-linked list.\n// #[derive(PartialEq, Eq, Clone, Debug)]\n// pub struct ListNode {\n//   pub val: i32,\n//   pub next: Option<Box<ListNode>>\n// }\n// \n// impl ListNode {\n//   #[inline]\n//   fn new(val: i32) -> Self {\n//     ListNode {\n//       next: None,\n//       val\n//     }\n//   }\n// }\nimpl Solution {\n    pub fn middle_node(head: Option<Box<ListNode>>) -> Option<Box<ListNode>> {\n        let mut cur = &head;\n        let mut node_vec: Vec<Option<Box<ListNode>>> = vec![];\n        \n        while let Some(node) = cur.as_ref() {\n            node_vec.push(Some(node.clone()));\n            cur = &cur.as_ref().unwrap().next;\n        }\n        \n        node_vec[node_vec.len() / 2].clone()\n    }\n}\n```
['Two Pointers', 'Rust']