Skip to content

Conversation

predam
Copy link
Contributor

@predam predam commented Apr 11, 2022

The solution is not working.

  1. treeDiameter should be cleared. leetcode runs multiple tests & the static value is persisted. (or better don't use static variable)
  2. single node TreeNode(1, null,null) should return 0
  3. diameter should be calculated when at least one leaf != 0

The solution is not working.

1. treeDiameter should be cleared. leetcode runs multiple tests & the static value is persisted. (or better don't use static variable)
2. single node TreeNode(1, null,null) should return 0
3. diameter should be calculated when at least one leaf != 0
@neetcode-gh neetcode-gh merged commit 0638dce into neetcode-gh:main Jun 8, 2022
neetcode-gh added a commit that referenced this pull request Jul 2, 2022
Update 543-Diameter-of-Binary-Tree.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants