662. Maximum Width of Binary Tree

  • iterative: save index of each node while queue nodes.
  • recursive: dfs, keep a array of left most nodes.

640. Solve the Equation

  • corner cases:
    • “0x=0”
    • “x=-x”
    • “x=-1”
    • “0x=-x”