message: Update maximum-width-of-binary-tree.cpp
diff: @@ -14,21 +14,20 @@ class Solution {
  public:
  int widthOfBinaryTree(TreeNode* root) {
  vector<int> leftmosts;
  - int result = 0;
  - dfs(root, 1, 0, &leftmosts, &result);
  - return result;
  + return dfs(root, 1, 0, &leftmosts);
  }
  private:
  - void dfs(TreeNode* node, int id, int depth, vector<int> *leftmosts, int *result) {
  + int dfs(TreeNode* node, int id, int depth, vector<int> *leftmosts) {
  if (!node) {
  - return;
  + return 0;
  }
  if (depth >= leftmosts->size()) {
  leftmosts->emplace_back(id);
  }
  - *result = max(*result, id - (*leftmosts)[depth] + 1);
  - dfs(node->left, id * 2, depth + 1, leftmosts, result);
  - dfs(node->right, id * 2 + 1, depth + 1, leftmosts, result);
  + int result = id - (*leftmosts)[depth] + 1;
  + result = max(result, dfs(node->left, id * 2, depth + 1, leftmosts));
  + result = max(result, dfs(node->right, id * 2 + 1, depth + 1, leftmosts));
  + return result;
  }
  };
  