Three Leetcode problems - Queens, Dice, Frequency
I'm solving three recent coding interview problems from Leetcode. Btw. you can turn on subtitles.
leetcode.com/problems/queens-...
leetcode.com/problems/dice-ro...
leetcode.com/problems/maximum...
Subscribe for more educational videos on algorithms, coding interviews and competitive programming.
- Frequently Asked Questions: github.com/Errichto/youtube/w...
- Github repository: github.com/Errichto/youtube
- KZread channel 1: / errichto (lectures and single problems)
- KZread channel 2: / errichto2 (streams)
- Competitive Programming Discord: discordapp.com/invite/UzaURu7
Пікірлер: 102
It was the first time I used software to draw on the screen over the statement/code instead of opening Paint or OneNote. Did you like it?
@masternobody1896
4 жыл бұрын
Nice
@masternobody1896
4 жыл бұрын
Epic
@pushpendrasingh1819
4 жыл бұрын
In this video, you had already read the question. We want you to read the question with us like it's a totally new question for you. Then you can discuss various approaches and their trade offs
@dsgarden
4 жыл бұрын
There is nothing you can write/draw that I would not like
@kavishdhamija7136
4 жыл бұрын
i liked it how can i do the same will save some paper
The quality of videos becomes cool every day (like passing coding parts fastly, explaining the idea in several words and etc...)
@Errichto
4 жыл бұрын
I'm glad you like the change in style/quality.
@fightingforcatalonia
4 жыл бұрын
Why taken[ queen[0] queen[1]] is defined this way?
So happy to see you think through these problems and letting us know that it’s okay not to have the most concise solution. I sometimes get tripped up by the most upvoted solution on Leetcode, but do not find it to be the most intuitive during our first try at an algorithm design. Thanks 🙏
Love your videos Errichto.Thanks for posting
"Apologies I don't understand!"
You are doing nice job dude, we appreciate it very much just keep up the good work and ignore the comments by people about your video quality and all, no one in youtube makes video like you make with such dedication in CP.
you are amazing, bro! hope to continue making great videos, and provide explanation as detailed as in this video!
You seem to be the only high level competitive programmer who makes such videos. Thank you, man
This is really great format, if you can teach the thought process to approach these problems, that's what counts, it will be legendary.
Love all the explanations, they are incredibly helpful. Errichto is a mathematical/counting lord in my eyes. Hope to see more diverse/abstract topics in the future. Thanks again for everything :)
Really liked this! Went on and did the problems on leetcode
The speed and clarity you solved these problems is legendary
this format is the best
Hi errichto! Amazing videos
nice format
errichto thanks man
plzz errichto sir create a series of competative coding videos from basics...plzz sir.....and thanks for this awesome video....such a unique piece of content..ur the best🤗
Awesome! God like coding skills!
Maybe consider creating a Udemy course for improving algorithmic skills.
Damn that dice DP problem seems way above medium level difficulty, am I wrong?
You are amazing bro.
doing the lord's work over there
Great lectures! Very helpful! offtop: What does Errichto mean?
@gatoradeee
4 жыл бұрын
He's answered this question many times, it doesn't mean anything. It's just some random word he came up with for a handle.
Excellent
0:50 "can we do something smarter?" -no "yes we can"
Can u do it for codeforces contest too
Well, imposter syndrome just increased exponentially.
How many problems are you solving per day ? Like in your practice routine
Do you think C++ is a requirement if you are serious about competitive programming? For example, is it possible to win a tournament using python?
Could you do some problems but in Javascript?Thanks.
@Errichto
4 жыл бұрын
No, because I don't know Javascript :(
The questions and solutions are quite overwhelming for me.......can you tell what to do to build such logic?
@chervilious
4 жыл бұрын
same I'm still first semester CS Student though
Please take some more time to discuss your intuition behind a problem. That would be a great help 😊
@Errichto
4 жыл бұрын
Well, I'm explaining my whole thinking process already.
@pushpendrasingh1819
4 жыл бұрын
@@Errichto I don't know you but you are like my brother. I have learnt a lot from you. Thank you for the videos. Love from India ❤️. Please add more leetcode videos as leetcode helps in problem solving and interview process.
what are d1 and d2 ? you talk something about delta .... can you plz help me to understand that..? Anyone?
That third problem "Maximum Equal Frequency" was originally asked in Codeforces DIV2 as problem B. I don't remember exactly which round it was. The editorial also came with the same solution as you.
@Errichto
4 жыл бұрын
@Ashar Oh, interesting. Do you have a link?
@coder3101
4 жыл бұрын
@@Errichto codeforces.com/contest/1163/problem/B2 Here you go.
These were contest problems from last week. Can you live stream leetcode contests? Neal wu, scott wu, uwi, kjmp and other pros also participate.
@Errichto
4 жыл бұрын
They are usually the middle of a night for me. I wanted to stream the last biweekly contest but I was busy that day.
@Errichto
4 жыл бұрын
And I will not live stream those contests, obviously. I might record it though :D
@santhoskumar1369
4 жыл бұрын
@@Errichto lol
Only if I was even 1% of your intelligence. 🙏🙏
7:50 Google assistant read my mind
00:04 1222. Queens That Can Attack the King ( Link : leetcode.com/problems/queens-that-can-attack-the-king/ ) 03:39 1223. Dice Roll Simulation ( Link : leetcode.com/problems/dice-roll-simulation/ ) 10:36 1224. Maximum Equal Frequency ( Link : leetcode.com/problems/maximum-equal-frequency/ )
I'm starting to learn programming and started a week ago and KZread for some reason recommends this video I'm afraid now.
@stargate4847
4 жыл бұрын
You do not have to be afraid of anything. Keep practicing and you will become a master of programming. Errichto has a lot of experience and he is sharing his knowledge to help us to find better solutions.
@noahg2
4 жыл бұрын
@@stargate4847 thanks bro I'll try my best
could you use other language such as phython?
@Errichto
4 жыл бұрын
I would need to learn Python better :D
I enjoy you walking through the problem and writing the code piece by piece. The only criticism I have is that you speak very fast. Your brain is moving faster than your mouth. I understand that. I'll just listen to you on .75 speed.
@Errichto
4 жыл бұрын
I don't agree that I'm talking too fast, so maybe let me ask others: is it true?
@SolidBroly
4 жыл бұрын
@@Errichto Its a probably just a problem for me lol
@rockycooldude4889
4 жыл бұрын
@@Errichto No absolutely not, infact I watch your videos at 1.25x
@Errichto Can you tell me what delta in rows/columns mean?? I have no idea what concept u r using...
@Errichto
4 жыл бұрын
It tells me if I should increase ROW coordinate and COL coordinate when moving to a neighbor (adjacent cell).
For dice I immediately thought 'matrix multiplication'.
What is your favorite language to leet code and why?
@msugal
4 жыл бұрын
He is a competitive programmer so he uses C++ because it is fast and gives u more control. I too myself use C++ or Java.
@Summersault666
4 жыл бұрын
@@msugal in most competitions you have to be fast on presenting the solutions, not normally the fastest implementation. So it's kind a bad decision to implement in Java or c++, unless using specific classes, or being forced to implement in a certain language.
@msugal
4 жыл бұрын
@@Summersault666 what I meant by fast is how the langauge processes data. C++ is known to be fast in that regard, also u rarely see Python used in competitive programming.
@Robert-lu3wc
4 жыл бұрын
@@Summersault666 actually, if you look at general competitive programming statistics, C++ and Java combined represent more than something like 90 or 95% of solutions while python is only used by 5 or so percent. I dont remember exactly the source of this, so I am slightly ballparking, but I can find the source if needed. If you've studied for ICPC its primarily all C++ due being fast and of course having STL support
it was hard to understand the dice simulator problem. Need to watch your dp lectures more thoroughly
Wow
Wait a minute, so for the second problem you at first got time of 52ms, then improved your solution and got 68ms? ;)
first here
You have lots of knowledge to share but nobody can find your videos. Nobody searches for "Three leetcode problems". Do 1 leetcode question per video and have the leetcode question name in the video title. Crank out as much as possible of these leetcode videos and put them into a youtube playlist.
I don't know I am making sense or not. But If you would solve problems which are popular, I mean in reference to leetcode, that would be more useful for everyone. As all the three problems was like 50 people liked 10 people disliked. I am sure there must be some fair reasons like those were already on youtube or those might be easy.
@Errichto
4 жыл бұрын
I just chose the most recent problems.
i think seperate video would be better and some more proper explination is required.
@Errichto
4 жыл бұрын
Dear Elon Musk, which problem didn't have a proper explanation? I think that I explain things in more detail than other channels, maybe just without going through multiple examples.
@shreekrishna6144
4 жыл бұрын
@@Errichto You certainly explain the best ,no doubts in that but had you prepared the solution before,it would have been better.This is regards to the 3rd problem,I think you could made the explanation better if you could just explained all the test cases at a time.I understand it was pretty difficult,I would not have been even able to solve it for many days.But this is just a feedback.
@wulymammoth
4 жыл бұрын
Elon Musk I would actually prefer that he not prepare the solution before. I like watching how he explores the problem having seen it for the first time. Because when people prepare in advance, they often leave out or forget to make aware of the struggle or insight and idea backtracking that they’ve done to arrive at a solution/algorithm
@Errichto
4 жыл бұрын
@@shreekrishna6144 Well, problems already have editorials or random posts in a forum. IMO the biggest value from my videos is that I show how I derive the solution.
U code faster than maggi 😂
I think you are so great at solving problem, but not so great at explaining how you come up with the solution...expecially for newbies...too many things are just mentioned without detailed explanation. According to me the second exercise DP explanation is something completely ununderstandable for common people. You have it so clear in your mind, that you forget that people are not in your mind while explaining...so please slow a bit down and use words/example that also a 5 years old child can understand while explaining logic behind your intuitions. It's perfectly clear that you are so talented at coding. That's my 2 cents.
@Errichto
4 жыл бұрын
I completely agree that I could make my videos longer and thus more accessible for beginners -- there are some disadvantages though. Every video will be boring for some people and hard to understand for others. You're basically suggesting to shift down the difficulty and thus change the audience I'm making these videos for. The thing with dp problems is that getting ideas boils down to experience of solving 10 similar problems before. You can stop a video and think about my approach and simulate some example yourself though. I will experiment in the future and try to make longer videos for some easy problems.
@abes975
4 жыл бұрын
@@Errichto Thanks a lot for your answer. With my comment I did not intended to tell you to change target audience of your videos, but just to spend a bit more time on some details that might be not so intuitive even for more expert people. (I.e order of visiting state in DAG for DP. If you see how you just skip over it fixing your code you will probably understand what i mean..that's a very crucial point in solving DP). Don't make videos longer..but try to focus on crucial details with easy words...or spending 10-20 seconds more on those details...
@SangharshSeth
4 жыл бұрын
@@abes975 Dude he is not here to spoon feed solutions to you like 5 years old if you want that there are plenty of resources he is perfectly explaining his approach and if it is too advanced for you then consider learning basics of programming