just one word for you sir legend .. your logic to solve the question is awesomeee
@Pepcoding3 жыл бұрын
Thankyou beta for such kind words. Keep watching and keep learning😊
@sharuk35453 жыл бұрын
@@Pepcoding thnks sir i recommended your videos my senior as well as my junior
@CobraAnkit11 ай бұрын
Sir, you should analyze the code of the question.
@vishwashdwivedi94694 жыл бұрын
Great work Sir ... Appreciable work !
@Pepcoding4 жыл бұрын
Thankyou beta! I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, will you like to write a few words about us here - g.page/Pepcoding/review?rc
@Sunny-qq6un2 жыл бұрын
thank you very very much sir, I have been stuck in this problem for 1 day, thanks a lot sir
@Pepcoding2 жыл бұрын
Happy to help. For better experience and well organised content sign up on nados.io And for being updated follow us on Instagram instagram.com/pepcoding/
@Now_I_am_all_fired_up2 жыл бұрын
Always :--- Love u Sir
@_hulk7482 жыл бұрын
thankyou sir❤❤🙏🙏
@nishthagoyal50184 жыл бұрын
You explain in a very nice way👍
@Pepcoding4 жыл бұрын
Thanks and welcome
@kunalchandra98693 жыл бұрын
Shakespeare of recursion😎!
@Pepcoding3 жыл бұрын
Haha Keep learning, Keep growing and keep loving Pepcoding!😊
@shubhamagarwal29983 жыл бұрын
awesome details and explanation sir
@Pepcoding3 жыл бұрын
Glad to know that you liked the content and thank you for appreciating. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos. So, keep motivating, keep learning and keep loving Pepcoding😊
@prateekbansal20143 жыл бұрын
sir please har video me question ki time or space complexity bhi bta diya karoo ... ya fir description me daal diya karoo
@sagarbhoi78732 жыл бұрын
nice sir
@ashutoshdixit28063 жыл бұрын
listen properly at 14.01 ... it make clear everything
@Pepcoding3 жыл бұрын
Thankyou buddy! If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
@mukultaneja72434 жыл бұрын
Great explanation sir ! Please tell.... how can we prevent the calls with empty array, because it may take much extra time in higher n and k values.
@Pepcoding4 жыл бұрын
break lgaya hai na, pehle empty set se.
@mukultaneja72434 жыл бұрын
@@Pepcoding oh okay sir got it ! Thankyou so much ❤️
@varsha42604 жыл бұрын
@@Pepcoding but sir ham yaha pe no of set==k check kar rahe hai na,so all those which have only k-1 elements or less than that we are making unecessary calls to it right!Is there any way to prevent making those extra calls?
@ShaniKumar-ql2ow4 жыл бұрын
you are doing great work sir ! please make videos on dp also.
@Pepcoding4 жыл бұрын
50 questions on DP just got done. Check this www.pepcoding.com/resources/online-java-foundation/dynamic-programming-and-greedy www.pepcoding.com/resources/data-structures-and-algorithms-in-java-levelup/dynamic-programming/
@lovi19994 жыл бұрын
Ekdum mast Sir.
@Pepcoding4 жыл бұрын
It's my pleasure!! keep watching and share as much as you can
@programmertik20463 жыл бұрын
n=3 1 2 3 k=3 Sir code will fail to handle it wont print anything this test case Correct me if im wrong !!! Baki continue your GOD level teaching sir !!!!
@Pepcoding3 жыл бұрын
Sorry, we won't be able to take your doubts here and assist you here. For better experience visit on nados.pepcoding.com
@srijandasbiswas48643 жыл бұрын
Sir ek bahut serious doubt hai ... Ye backtracking kaab jarurat hai ye samajne me thoda problem ho rhi , i mean normal recursion me bhi jab wapas aayega control toh bhi chize toh undo ho jaati hai na Like level1 pe wapas aaya control toh bhi normally level2 ke chize toh undo ho hi jayegi right??
@Pepcoding3 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@ankitgupta-ph4nk2 жыл бұрын
Sir everything is fine here, here we are printing the list and removing, what if i want to return the whole list of k partition subset from this method.
@harshtekriwal1314 жыл бұрын
Sir I tried this logic on leetcode but it exceeds time even after many optimizations, is there a better approach for this question?
@tarushiarora68873 жыл бұрын
exactly....can you tell name of this question in Leetcode?
@vibhanshattri3 жыл бұрын
Do memoisation
@aayushpagare93663 жыл бұрын
PLEASE CAN YOU TELL QUESTION NAME AND NUMBER ?
@hrithikpandey26563 жыл бұрын
@@aayushpagare9366 698. Partition to K Equal Sum Subsets
@mayur_madhwani033 жыл бұрын
class Solution { public: bool ans = false; bool isValid(vector& sums){ int n = sums.size(); for(int i = 0 ; i < n - 1 ; i++){ if(sums[i] != sums[i+1])return false; } return true; } void solve(vector& a, int idx, vector& sums, int target){ if(ans == true)return; if(idx == a.size()){ if(isValid(sums))ans = true; return ; } for(int i = 0 ; i < sums.size() ; i++){ if(sums[i]>0 && sums[i] + a[idx]
@nishitadash9713 жыл бұрын
Sir, what if the requirement for partition is contiguous? for example in the set [1,2,3] with k=2.... (13 | 2) cannot be one of the subsets. it can be only ( 12 | 3) or (1 | 23)...? how should I approach this sir?
@punyaslokdutta43622 жыл бұрын
Prefix Sum
@AbhijeetSachdev Жыл бұрын
nC(k-1)
@utpalpodder-pk6vq3 жыл бұрын
sir can you please check this input [5,2,5,5,5] 3 its generating some duplicate sequence of outputs... i am facing this issue with leetcode :698. Partition to K Equal Sum Subsets
@utpalpodder-pk6vq3 жыл бұрын
one way I thought i could restrict the processing of duplicate sequence by maintaining a global var which can keep track of the intermediate result ....but its seems not a memory efficient soln....if there any better way I could get rid of it please share it....
@Pepcoding3 жыл бұрын
Gimme some time, I'll check it and beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@Yash-uk8ib3 жыл бұрын
@@utpalpodder-pk6vq sir did u get it now?? plzz share with me!! struggling with the same
@hymnish_you3 жыл бұрын
For those who are getting TLE. Sort the array in reverse.
@programmertik20463 жыл бұрын
how does this help can you explain ??
@vaibhaves4 жыл бұрын
Can you do the egg drop problem? with which floors to drop the eggs from . thanks
@Pepcoding4 жыл бұрын
Sure!
@yogita8683 жыл бұрын
Sir please upload the solution of a magnet puzzle problem
@011_tanyadixit42 жыл бұрын
Thank you so much for your insightful explanations sir :) p.s. is this question on leetcode I can't find it
@live_study_with_me2 жыл бұрын
similar problem is there leetcode 473. Matchsticks to Square
@RahulKumar-od6zk3 жыл бұрын
Sir level 2 me aur videos kab aa rhe????
@Pepcoding3 жыл бұрын
Jldi he resume krege beta, most probably by the end of this month.
@RahulKumar-od6zk3 жыл бұрын
@@Pepcoding thank you so mush sir, Respect 3000
@sakshamkumarsharma23094 жыл бұрын
Hi sir should i do your 2500 list of questions of DSA or 500 list of questions of DSA. I am currently in my 2nd year. Please help sir i am really confused
@Pepcoding4 жыл бұрын
500 wali
@vinay81634 жыл бұрын
2500 question ki list dena bhaai ?
@garima65712 жыл бұрын
Can u please provide the code in description in c++?
@Pepcoding2 жыл бұрын
check it out on nados.io
@_busybee233 жыл бұрын
GOD
@Pepcoding3 жыл бұрын
Glad to know that you liked the content and thank you for appreciating. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos. So, keep motivating, keep learning and keep loving Pepcoding😊
@Elon-musk-0074 жыл бұрын
How do we know that backtracking is needed or not needed;
@Pepcoding4 жыл бұрын
beta jahan level aur options ki feel aaegi to backtracking lagegi. jahan options dikhne lagein
bilkul lga sakte the. level1 mei print sequence mei lgai hai.
@rahulranjan75673 жыл бұрын
@@Elon-musk-007 JIdhar bhi multiple calls lagti hai and jidhar bhi tumhari input ko reuse karne ka locha hota hai udhar Backtracking laga sakte hai. Idhar se hi DP nikalti hai with slight modifications. Bass yeh samjh lo ki agar problem overlap ho rahi hai toh backtracking lagg sakti hai
@Elon-musk-0073 жыл бұрын
@@rahulranjan7567 Thanks bro
@KAMALKAMAL-ig6qc4 жыл бұрын
Sir ek din mein 1-2 questions hi kyu daal rhe ho??
@Pepcoding4 жыл бұрын
jaanke nahi yar. kuch income tax ka kaam aya hua hai. jyada karenge asap. at-least 10-12 per day.
@RajatSingh-dg8ov4 жыл бұрын
Hi sir This code is giving tle on leetcode
@Pepcoding4 жыл бұрын
Okay beta, lemme have a look
@RajatSingh-dg8ov4 жыл бұрын
@@Pepcoding thank you sir, thanks for the prompt reply.
@shubhamaggarwal38234 жыл бұрын
sir , 720p daalo atleast plz.
@Pepcoding4 жыл бұрын
ab theik ho gai hogi.
@prahladrana63914 жыл бұрын
sir , ye smjh nhi aaya ki pehli baar jb 1 add hua tb uske liye bhi do calls lagi thi. one where it is added into the existing set and the other where it creates its own set, sir 1 k liye kya hoga matlab nhi ayaa smjh..
@prahladrana63914 жыл бұрын
please guide me sir
@Pepcoding4 жыл бұрын
nhi bro. ya to existing non-empty set mei add hona hai ya pehle empty set mei. 1 ko to sare sets empty he mile na.
@prahladrana63914 жыл бұрын
@@Pepcodingmeans 1 will never execute that if block.
@ashutoshdixit28063 жыл бұрын
****AaAgGg!!!!!!
@Pepcoding3 жыл бұрын
🔥☄️😬🙊
@AmandeepSingh-ot6st4 жыл бұрын
Bhaya ....c++ mai bhi code likh kar dikhaaya karo.... Ab...kuch bachcho ko java Puri nhi aati ....toh pehle java padhni hogi ...phir code ka flow samaj aayega....phir c++ padhne ka kya hi faayeda... Plzzz...Bhai...c++ mai bhi code likhar dikha diya karo......bahut pareshaani hoti hai...java ka code samajne mai...kyui ye ArrayList Sabhi c++ mai nhi hai...🙄
@Pepcoding4 жыл бұрын
Iske pehle 5 lecture karlo. Basic Java 2-3 din mei aa jaegi. www.pepcoding.com/resources/online-java-foundation