Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Id you have worked upon -
Kindly write your answer here
Briefly explain your program logic -
Full nodes are the ones whose left and right children are not null. So the idea is to traverse the tree in postorder. If the current node is full, we increment result by 1 and add returned values of left and right subtrees.
Screenshots(Attach 2 screenshots of your own input and output) -
Attach here
Checklist:
Eg - If your code follow the below guidelines. Kindly change [] to [x]
All the conditions should be fulfilled for considering your code for merging -
[] I have mentioned the question as comment in my solution file.
[] My code follows the guidelines of this project.
[] I have performed a self-review of my own code.
[] I have commented my code.
[] My code gives the correct output.
[] I confirm that I have not copied the code from anywhere. In case its found that I have copied even after successful merge then I can be banned from the repository and hacktoberfest.
[] I affirm that I strictly follow contributing guidelines and code of conduct.