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

  • @Errichto
    @Errichto4 жыл бұрын

    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

    @masternobody1896

    4 жыл бұрын

    Nice

  • @masternobody1896

    @masternobody1896

    4 жыл бұрын

    Epic

  • @pushpendrasingh1819

    @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

    @dsgarden

    4 жыл бұрын

    There is nothing you can write/draw that I would not like

  • @kavishdhamija7136

    @kavishdhamija7136

    4 жыл бұрын

    i liked it how can i do the same will save some paper

  • @kerimkochekov
    @kerimkochekov4 жыл бұрын

    The quality of videos becomes cool every day (like passing coding parts fastly, explaining the idea in several words and etc...)

  • @Errichto

    @Errichto

    4 жыл бұрын

    I'm glad you like the change in style/quality.

  • @fightingforcatalonia

    @fightingforcatalonia

    4 жыл бұрын

    Why taken[ queen[0] queen[1]] is defined this way?

  • @wulymammoth
    @wulymammoth4 жыл бұрын

    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 🙏

  • @siddhantkumar1028
    @siddhantkumar10284 жыл бұрын

    Love your videos Errichto.Thanks for posting

  • @flyLeonardofly
    @flyLeonardofly4 жыл бұрын

    "Apologies I don't understand!"

  • @vikasvishwakarma5263
    @vikasvishwakarma52634 жыл бұрын

    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.

  • @zhengxunwu2060
    @zhengxunwu20604 жыл бұрын

    you are amazing, bro! hope to continue making great videos, and provide explanation as detailed as in this video!

  • @RenatKaitmazov
    @RenatKaitmazov4 жыл бұрын

    You seem to be the only high level competitive programmer who makes such videos. Thank you, man

  • @BABRY93
    @BABRY934 жыл бұрын

    This is really great format, if you can teach the thought process to approach these problems, that's what counts, it will be legendary.

  • @Zzznmop
    @Zzznmop4 жыл бұрын

    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 :)

  • @fbru02
    @fbru024 жыл бұрын

    Really liked this! Went on and did the problems on leetcode

  • @edgarsanmartinjr.4278
    @edgarsanmartinjr.42783 жыл бұрын

    The speed and clarity you solved these problems is legendary

  • @akramelomrani8728
    @akramelomrani87282 жыл бұрын

    this format is the best

  • @coolguy-dw5jq
    @coolguy-dw5jq4 жыл бұрын

    Hi errichto! Amazing videos

  • @rohan8arora
    @rohan8arora4 жыл бұрын

    nice format

  • @Sksahu_123
    @Sksahu_1233 жыл бұрын

    errichto thanks man

  • @avocode1487
    @avocode14874 жыл бұрын

    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🤗

  • @kitgary
    @kitgary4 жыл бұрын

    Awesome! God like coding skills!

  • @thedankest1974
    @thedankest19744 жыл бұрын

    Maybe consider creating a Udemy course for improving algorithmic skills.

  • @MrWolfgangWeiss
    @MrWolfgangWeiss4 жыл бұрын

    Damn that dice DP problem seems way above medium level difficulty, am I wrong?

  • @stargate4847
    @stargate48474 жыл бұрын

    You are amazing bro.

  • @themispapavasileiou7872
    @themispapavasileiou78724 жыл бұрын

    doing the lord's work over there

  • @atalykakash6181
    @atalykakash61814 жыл бұрын

    Great lectures! Very helpful! offtop: What does Errichto mean?

  • @gatoradeee

    @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.

  • @toofangaming6380
    @toofangaming6380 Жыл бұрын

    Excellent

  • @VictorNascimentoo
    @VictorNascimentoo4 жыл бұрын

    0:50 "can we do something smarter?" -no "yes we can"

  • @sriharshaananthoju8671
    @sriharshaananthoju86714 жыл бұрын

    Can u do it for codeforces contest too

  • @tannerbarcelos6880
    @tannerbarcelos68804 жыл бұрын

    Well, imposter syndrome just increased exponentially.

  • @neilgnortsmra902
    @neilgnortsmra9024 жыл бұрын

    How many problems are you solving per day ? Like in your practice routine

  • @xXxBladeStormxXx
    @xXxBladeStormxXx4 жыл бұрын

    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?

  • @micosair
    @micosair4 жыл бұрын

    Could you do some problems but in Javascript?Thanks.

  • @Errichto

    @Errichto

    4 жыл бұрын

    No, because I don't know Javascript :(

  • @mayurshende6731
    @mayurshende67314 жыл бұрын

    The questions and solutions are quite overwhelming for me.......can you tell what to do to build such logic?

  • @chervilious

    @chervilious

    4 жыл бұрын

    same I'm still first semester CS Student though

  • @pushpendrasingh1819
    @pushpendrasingh18194 жыл бұрын

    Please take some more time to discuss your intuition behind a problem. That would be a great help 😊

  • @Errichto

    @Errichto

    4 жыл бұрын

    Well, I'm explaining my whole thinking process already.

  • @pushpendrasingh1819

    @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.

  • @Shubham-ny2ce
    @Shubham-ny2ce4 жыл бұрын

    what are d1 and d2 ? you talk something about delta .... can you plz help me to understand that..? Anyone?

  • @coder3101
    @coder31014 жыл бұрын

    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

    @Errichto

    4 жыл бұрын

    @Ashar Oh, interesting. Do you have a link?

  • @coder3101

    @coder3101

    4 жыл бұрын

    @@Errichto codeforces.com/contest/1163/problem/B2 Here you go.

  • @gatoradeee
    @gatoradeee4 жыл бұрын

    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

    @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

    @Errichto

    4 жыл бұрын

    And I will not live stream those contests, obviously. I might record it though :D

  • @santhoskumar1369

    @santhoskumar1369

    4 жыл бұрын

    @@Errichto lol

  • @Rohitsingh2410
    @Rohitsingh24104 жыл бұрын

    Only if I was even 1% of your intelligence. 🙏🙏

  • @amanmahendroo1784
    @amanmahendroo17843 жыл бұрын

    7:50 Google assistant read my mind

  • @kunal_chand
    @kunal_chand3 жыл бұрын

    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/ )

  • @noahg2
    @noahg24 жыл бұрын

    I'm starting to learn programming and started a week ago and KZread for some reason recommends this video I'm afraid now.

  • @stargate4847

    @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

    @noahg2

    4 жыл бұрын

    @@stargate4847 thanks bro I'll try my best

  • @drexeltimogtimog5700
    @drexeltimogtimog57004 жыл бұрын

    could you use other language such as phython?

  • @Errichto

    @Errichto

    4 жыл бұрын

    I would need to learn Python better :D

  • @SolidBroly
    @SolidBroly4 жыл бұрын

    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

    @Errichto

    4 жыл бұрын

    I don't agree that I'm talking too fast, so maybe let me ask others: is it true?

  • @SolidBroly

    @SolidBroly

    4 жыл бұрын

    @@Errichto Its a probably just a problem for me lol

  • @rockycooldude4889

    @rockycooldude4889

    4 жыл бұрын

    @@Errichto No absolutely not, infact I watch your videos at 1.25x

  • @sriramnarayanan3619
    @sriramnarayanan36194 жыл бұрын

    @Errichto Can you tell me what delta in rows/columns mean?? I have no idea what concept u r using...

  • @Errichto

    @Errichto

    4 жыл бұрын

    It tells me if I should increase ROW coordinate and COL coordinate when moving to a neighbor (adjacent cell).

  • @CarrotCakeMake
    @CarrotCakeMake4 жыл бұрын

    For dice I immediately thought 'matrix multiplication'.

  • @Summersault666
    @Summersault6664 жыл бұрын

    What is your favorite language to leet code and why?

  • @msugal

    @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

    @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

    @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

    @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

  • @foysalkhan4214
    @foysalkhan42144 жыл бұрын

    it was hard to understand the dice simulator problem. Need to watch your dp lectures more thoroughly

  • @cocoarecords
    @cocoarecords4 жыл бұрын

    Wow

  • @alphabeta3029
    @alphabeta30294 жыл бұрын

    Wait a minute, so for the second problem you at first got time of 52ms, then improved your solution and got 68ms? ;)

  • @eboujobe743
    @eboujobe7434 жыл бұрын

    first here

  • @MrDivad006
    @MrDivad0064 жыл бұрын

    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.

  • @AbhishekKumar-yv6ih
    @AbhishekKumar-yv6ih4 жыл бұрын

    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

    @Errichto

    4 жыл бұрын

    I just chose the most recent problems.

  • @shreekrishna6144
    @shreekrishna61444 жыл бұрын

    i think seperate video would be better and some more proper explination is required.

  • @Errichto

    @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

    @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

    @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

    @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.

  • @sriharshaananthoju8671
    @sriharshaananthoju86714 жыл бұрын

    U code faster than maggi 😂

  • @abes975
    @abes9754 жыл бұрын

    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

    @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

    @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

    @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