2872. Maximum Number of K-Divisible Components | leetcode daily challenge | shashcode30

  Рет қаралды 2,029

shashCode

shashCode

Күн бұрын

Пікірлер: 14
@shashwat_tiwari_st
@shashwat_tiwari_st 2 күн бұрын
like target is 150. Please do like and comment, if you have understood the explanation as well as code😄
@harshthakre1700
@harshthakre1700 2 күн бұрын
sir when will you start dp series
@nihalsingh6233
@nihalsingh6233 Күн бұрын
Sir, you haven't uploaded todays leetcode daily challenge !!!!
@bhushanambhore8378
@bhushanambhore8378 7 сағат бұрын
where are you? why not uploading POTD leetcode?
@Ajay-cv1zs
@Ajay-cv1zs 2 күн бұрын
One Thing that can be done to handle large sum is to return sum%k (only the remainder).
@Official_Saint
@Official_Saint 2 күн бұрын
amazing explanations.
@mr.nishantawasthi4402
@mr.nishantawasthi4402 5 сағат бұрын
Sir Dp kb se start kar rahe hai aap?
@bhushanambhore8378
@bhushanambhore8378 2 күн бұрын
I dont get the point of why there is need of comopnentCount to be an array of length 1 instead of simply being an integer?
@shashwat_tiwari_st
@shashwat_tiwari_st 2 күн бұрын
@@bhushanambhore8378 java is pass by value, kuch be change kra toh update ni hoga. Cpp me chal jaega woh pass by reference hota h
@bhushanambhore8378
@bhushanambhore8378 2 күн бұрын
@shashwat_tiwari_st ohh thanks, it's new for me. I haven't came across such problem where we do this.
@nishantrathore5031
@nishantrathore5031 2 күн бұрын
sir can we use disjoint set in this question to group all those components whose sum is divisible by k ?
@karmaff6516
@karmaff6516 2 күн бұрын
Hello Sir, might be a silly question or maybe i didn't understand the problem but , is it possible that in the second example values[0] isn't divisible by given k=3 even after getting 0s from all subtrees. if yes, how is this approach handling that case.
@B-Billy
@B-Billy 2 күн бұрын
In Question it's mentioned that sum of all node will be divisible by K. So if left and rigth are divisible by K, left will make a component and right will ake a component. So parent will always be divisible by K. Eg. If total sum of array is 9. Left is 3, right is 3. So the root value will be 9-3-3 = 3 , 3 is divisible by K. Watch at 1:42
@karmaff6516
@karmaff6516 2 күн бұрын
got it thanks !! ​@@B-Billy
Maximum Number of K Divisible Components | Leetcode 2872
16:55
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Try this Web Scraping Project with Mongodb (Code Along)
32:54
John Watson Rooney
Рет қаралды 742
3397. Maximum Number of Distinct Elements After Operations | Greedy
11:14
CppCon 2014: Mike Acton "Data-Oriented Design and C++"
1:27:46
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.