LeetCode Week 1 Summary + Divide&Conquer and More
Week 1 Summary of solving Leetcode coding interview problems daily. I will talk about harder versions of some problems.
All codes: github.com/Errichto/youtube/t...
0:34 Week Summary
3:05 Divide & Conquer (Max Subarray)
14:57 Best time to buy & sell, why greedy differences work?
18:32 Best time to buy & sell, Multiple units dp
20:07 Best time to buy & sell, Multiple units, greedy-ish solution
32:28 IOI 2015 problem "Horses"
Leetcode holds a 30-day Challenge in April with a new coding interview problem appearing each day. I'm participating and will upload a video for each day just after the deadline at midnight PST. Participate here leetcode.com/explore/featured...
Subscribe for more educational videos on algorithms, coding interviews and competitive programming.
- Github repository: github.com/Errichto/youtube
- Live streams on 2nd YT channel and on Twitch: / errichto2 & / errichto
- FB and Twitter: / errichto & / errichto
- Frequently Asked Questions: github.com/Errichto/youtube/w...
#Coding #Programming
Пікірлер: 95
Thanks for such detailed and high-quality content on the 30-day LeetCode challenge. I check out your videos every day after completing the day's challenge. It provides us with more insights and methods to solve the problems. Keep the good work going. Cheers!!
This is what makes someone a pro... he do not know the solution but solutions........ Erricto : give me a problem , i will give you solutions . You may appreciate any solution....
You're the first person I've subscribed to on KZread. I'm learning a lot and hope to learn more from you! Hope you don't feel too rushed to make them and keep doing at your own pace! :) Appreciate the effort you put into making this!
I'm really loving this content. Very motivating to do the challenge along with these series. Keep it up and good luck for 1A!
Watched the whole thing! First of all, thank you so much for making it 🙏 I enjoyed it a lot and highly appreciate your effort. I'm fairly new to Competitive Programming, so I learned quite a lot from this video 👍You're just great as a teacher. A video series about solving techniques such as Divide & Conquer would be awesome!
Bro, I am your fan. I love ur passion & dedication. I will also reach ur Programming level one day.
@ItumelengS
4 жыл бұрын
Yeah he is good
@kaiovieira230
4 жыл бұрын
me too. I agree.
Thanks errichto for all these tutorial getting a lot to learn from you please continue these things even after the lockdown goes away. Thanks a lot.☮️✌️
I haven't seen the whole video yet! but I know you are awesome!
Bro, You are awesome. Your commitment to the community is impeccable.
Hi Errichto. I have been following your videos lately and I find them really helpful. A huge thanks to you. Can you please make a video explaining LeetCode's problem 'K-th Symbol in Grammar' !
If you are searching for codes, the links are in the description, he forgot to say it in the beginning of the video
I loved this! Thanks so much
21:22 FYI in stock market we can also sell first then we can buy it called a shorting of shares.
Hey man I love your videos I wish I can pay you so you can continue doing them :D Don't stop
Thank You for creating awesome contents. :)
Thanks for this video. Do you have summary of other weeks?
Awesome content!
Hey can enyone explain the third graph in best time to buy and sell stock, how did they graph it and how did they get the array?
Hi! You are doing a great job. How many problems should i solve every day to improve my problem solving skills?
u are such a great person
Thanks for the videos!Regarding the maximum consecutive subarray, basically we are using kadane's algorithm in the left and right side, right?
Hi Errichto. Thanks for your videos. As I enjoy competitive programming I also enjoy watching your videos. For "Maximum Subarray" problem if we calculate the cumulative sums benefiting the current divide and conquer approach (O(1) time for each interval), we can achieve O(n) complexity for this problem in total, can't we (sum of geometric progression with O(1) complexity operations)?
pro coder hehe :) enjoyed solutions
Thanks for such awesome content!
How do you solve the hard version of "when to buy and sell stock" using segment tree? I thought about it and the only way i can think of doing it uses lazy propagation, so i was wondering if that can be avoided
Can you make a video on converting any recursion to dynamic. I personally feel trouble in memoization . deriving a formula for it as they are very different depending on the problem.
Hi, I new to c++ and have a question. In the first problem, he call the function inside of the function itself to initialize for the variable ans. But how can that variable be returned in the first place for those "calling" of function? Or wouldn't it just go infinitely because of the creation of the subaarray? Can somebody help me wrap my head around this? Thanks in advance
I am currently unable to understand the stock problem with DP, not so confident in Dp :(
#Errichto Superb Explanation. Would love if you care to make a series of video for segment trees. It's one of those topics for which quality resources are quite scarce. Thanks for the effort!
In the greedy solution for buy stocks problem how does it makes sure that at the end i have no stock ? i.e i sell all my stocks at the end
Haven't heard about monotonic queues before this video. Can someone point out resources where to learn these kind of non-textbook data structures? Thanks in advance.
Thank you i learn a lot from you. But i wanna more, What if you do live code fight with other youtuber programmer ? and who did solved problem first be the winner. its gonna be amazing content !
@Errichto
4 жыл бұрын
I will do that after Leetcode April Challenge ends.
best video!
Errichto : The LeetCode challenge KZread Captions : Delete Code challenge
Blablabla! Thank you for the video!
best programming related stuff on youtube . @Errichto Just one request, I am able to do A.B,C and very rarely D (with hint )problem in ccodeforces Div2 could you please make some video or give some tips to solve D,E and F . It's like I am little stuck in this moment to cross that barrier . By the way your content and approach to solve problem is awesome that is why you are legend :)
@manavmohata1240
4 жыл бұрын
Which year are u in?
@RiteshKumar-qk6uy
4 жыл бұрын
@@manavmohata1240 i did not get you .. why that is important ?
@manavmohata1240
4 жыл бұрын
@@RiteshKumar-qk6uy just asking
@RiteshKumar-qk6uy
4 жыл бұрын
@@manavmohata1240 1st year mtech
Liked before watching!
bro can you do an explanation for the sudoku solver problem
bro your explanations for problems are super and love from India
good luck for code jam !
Can you do Python code instead of C++ ? or both of them
making two subvectors make it easy to understand and apply, but should we worry about the time it takes to make sub vectors and use two pointers? is the time added considerable?
@Errichto
4 жыл бұрын
It would be faster to just keep one vector/array and keep passing indices of left and right end recursively, yes.
Hi Errichto, thanks for the summary! Can I ask what your setup is for writing and illustrating, i.e. the software and hardware?
@Errichto
4 жыл бұрын
OneNote for drawing, and read my FAQ github.com/Errichto/youtube/wiki/FAQ#computer-configuration-os-ide-keyboard-etc
@yiminglin8716
4 жыл бұрын
@@Errichto Thanks!
Please solve codechef April challeng problem STRNO plzzz plzz
How about building a team that will edit ur videos and handle ur KZread channel. Basically you get to code and leave all the social media work to your management team
@Errichto
4 жыл бұрын
I think I must do this in the long run, but most time is editing and it's just part of what the video will be. I know what I want to convey, and white editing I check for mistakes :/ a random person won't do that well
@suvadeepghoshal
4 жыл бұрын
@@Errichto: at least try for monetization now. Your content and quality have improved. Financial independence is essential! Huge love and respect from India
I am finding all these very difficult 😔
Is it possible to solve the DP approach of buying and selling stock using Convex Hull Trick?
@Errichto
4 жыл бұрын
I don't think so, but maybe parametric search (trick from Aliens) will do the job.
@shivaraj-bh
4 жыл бұрын
@@Errichto I think even parametric search exploits the convex nature of a cost function, which is similar to what Convex Hull Trick does, isn't it?
@Errichto
4 жыл бұрын
@@shivaraj-bh Convex Hull Trick makes sense for linear/quadratic cost functions only, while parametric search doesn't have that limitation (but it has a requirement of f(k) being convex where k is number of used objects/transactions).
@shivaraj-bh
4 жыл бұрын
@@Errichto Yeah right. I will try implementing using parametric search.
For harder problem of divide and conquer, can't you solve it with MaxQueue + Sliding Windows? (if that's what a Monotonic Queue is, I'm sorry I don't really know that with that name). For divide and conquer solution, if I understand correctly, you store prefix and suffix maximum and get max of every prefix + sufix such that size of suffix is Y and prefix is K - Y?
@Errichto
4 жыл бұрын
Monotonic Queue is exactly O(N) max queue with sliding window. Yes, you are right about Y and K-Y thing.
@PasselivreEdicoes
4 жыл бұрын
@@Errichto Alright thanks a lot
There are no timestamps in the description :(
@Errichto
4 жыл бұрын
Added now :)
@Pctech4uproductions
4 жыл бұрын
@@Errichto 10q
Errichto, can you solve the same problems in java which would be helpful to many others.
Hey my dear, Please let us know how did you done that too faster? How are you practicing and from where to become master at DSA?
Errichto I am a huge fan of yours!! do u code all the day or u even work somewhere!!!! Why don't u do some q&a session?
@080rohitdatta2
4 жыл бұрын
check the description. And read FAQ
Live Streams? 😧😱
Create your own course and i will buy it
@nullnull6032
4 жыл бұрын
+1
He is good at competition, but sucks at explanation.
@kalenzo78
4 жыл бұрын
Watch Netflix bro...You an the wrong street
@angiras07
4 жыл бұрын
You wrong
@angiras07
4 жыл бұрын
@@audiogear4412 lol
@audiogear4412
4 жыл бұрын
Watch the complete video before giving me any comments.
@Errichto
4 жыл бұрын
Say exactly what explanation was bad (maybe with timestamps?) and I will be happy to improve on that in the future ;)
Hey can enyone explain the third graph in best time to buy and sell stock, how did they graph it and how did they get the array?