Kth Largest Level Sum in Binary Tree
You are given the root of a binary tree and a positive integer k.
The level sum in the tree is defined as the sum of the values of all nodes at the same depth (level) in the tree.
Your task is to find the kth largest level sum in the given binary tree. If there are fewer than k levels in the tree, print -1.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)