Maximum Number of K-Divisible Components | Leetcode 2872 | DSA | HIndi Explain | Code With Deepak
Автор: Code with Deepak
Загружено: 2025-11-27
Просмотров: 226
In this video, we solve Leetcode 2872. Maximum Number of K-Divisible Components using Java.
Question Link - https://leetcode.com/problems/maximum...
Solution: https://github.com/deepak-sharma-iOS/...
Summary:
This solution builds the tree and performs a DFS from the root.
Each child subtree returns its total sum; if that sum is divisible by **k**, it forms a separate component and is counted.
Otherwise, the subtree value is added to its parent’s sum.
Finally, the remaining root component is counted (initial count = 1).
Subscribe - / @debugwithdeepak
Github - https://github.com/deepak-sharma-iOS/...
Linkedin - / deepak-sharmaa-dev
#CodeWithDeepak #LeetCodeDailyChallenge #LeetCodeSolutions #DSAforInterviews #CodingWithExplanation #TechInterviewPrep #CrackTheCodingInterview #DailyCodingChallenge #JavaCoding #LearnToCode #CodingShorts #leetcodedailychallenge #euclidean
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: