NeetCode #428LC-2583MediumTrees
← Back to All Problems

#428 · #2583 · Kth Largest Sum in a Binary Tree(二叉树中的第 K 大层和)

📌 Problem Statement & Constraints

You are given the root of a binary tree and a positive integer k. Return the k-th largest level sum (the sum of node values at each level), or -1 if there are fewer than k levels. Constraints: the number of nodes is in [1, 10^5], 1 <= Node.val <= 10^6, 1 <= k <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!