leetcode_test_utils/tree/
template.rs1pub const TREE_INIT_TEXT: &str = r"// Definition for a binary tree node.
7// #[derive(Debug, PartialEq, Eq)]
8// pub struct TreeNode {
9// pub val: i32,
10// pub left: Option<Rc<RefCell<TreeNode>>>,
11// pub right: Option<Rc<RefCell<TreeNode>>>,
12// }
13//
14// impl TreeNode {
15// #[inline]
16// pub fn new(val: i32) -> Self {
17// TreeNode {
18// val,
19// left: None,
20// right: None
21// }
22// }
23// }
24use std::rc::Rc;
25use std::cell::RefCell;";
26
27pub const TREE_SHORTCUTS_TEXT: &str = r"type TreeHandle = Option<Rc<RefCell<TreeNode>>>;
29type ORRT = Option<Rc<RefCell<TreeNode>>>;
30type RRT = Rc<RefCell<TreeNode>>;
31type RT = RefCell<TreeNode>;";