The +12 there is so that % works correctly (ie the number never becomes negative)
fn get_depth(root_opt: &Option<Box<TreeNode>>) -> usize {
let root = match root_opt {
Some(root) => root,
None => return 0;
};
1 + std::cmp::max(get_depth(root.borrow().left), get_depth(root.borrow().right))
} - how you test your code after you finish coding
- what clarifying questions you asked to tease out a concrete question
- what edge cases you thought of and how you handled them
- how you handle bugs if they appear in the code
- what solutions you presented and what their tradeoffs were, and why you decided to use a particular solution
- whether your code was idiomatic
- whether you used clean abstractions
- maybe also comments and variable naming
... and probably others I'm missing.