Medium
LeetCode 606: Construct String from Binary Tree
·1 min
LeetCode
Medium
String
Tree
Depth-First-Search
Binary-Tree
LeetCode 606 note: output in pre-order, keeping an empty () when only the left subtree is missing, and omitting the right parentheses when it is empty
LeetCode 237: Delete Node in a Linked List
·1 min
LeetCode
Medium
Linked-List
LeetCode 237 note: without the previous node, copy the next node’s value over and delete the next node instead
LeetCode 235: Lowest Common Ancestor of a Binary Search Tree
·2 mins
LeetCode
Medium
Tree
Depth-First-Search
Binary-Search-Tree
Binary-Tree
LeetCode 235 note: go left when both p and q are smaller, right when both are larger; otherwise (split, or one is the node itself) this node is the LCA
LeetCode 2: Add Two Numbers
·2 mins
LeetCode
Medium
Linked-List
Math
Recursion
LeetCode 2 note: digits are stored in reverse, so add from the head digit by digit with a carry, looping until both lists end and no carry remains
LeetCode 7: Reverse Integer
·2 mins
LeetCode
Medium
Math
LeetCode 7 note: remember the sign, reverse the digits of the absolute value, and return 0 when the result leaves the signed 32-bit range