Winning LeetCode Weekly Contest 201

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มิ.ย. 2024
  • Didn't expect a win... But I'll take it!
    leetcode.com/contest/weekly-c...
    Second channel (William Lin ++): / @williamlinpp4187
    Website: williamlin.io/
    Instagram: / tmwilliamlin168
    Twitter: / tmwilliamlin168
    Discord: williamlin.io/discord
  • เกม

ความคิดเห็น • 159

  • @TrenBlack
    @TrenBlack 3 ปีที่แล้ว +542

    William Lin in a few years: "Didn't expect to recieve a Turing award... But I'll take it!"

  • @rayanbaida
    @rayanbaida 3 ปีที่แล้ว +545

    this guy solves the questions faster than i can read them

    • @samkarpa4937
      @samkarpa4937 3 ปีที่แล้ว +4

      😂😂🤣

    • @jhonx1420
      @jhonx1420 3 ปีที่แล้ว +5

      LoL true

    • @FFMAN3
      @FFMAN3 3 ปีที่แล้ว +29

      That's because he has done so many similar questions, he recognizes a problem with first word and doesn't read whole question

    • @VrickzGamer
      @VrickzGamer 3 ปีที่แล้ว +1

      @@dsa5821 No Red code is William Liner

    • @nightcoder5k
      @nightcoder5k 2 ปีที่แล้ว +10

      You can get ahead of him by pausing the video and reading. LOL

  • @kishorprasad3817
    @kishorprasad3817 3 ปีที่แล้ว +244

    Hey William, Lately I observed that you are taking part in almost all leetcode contest, kindly upload videos whether you win or not, even if you don't perform well, we learn how you debug things and come to optimised solution.. Your videos are quite helpful. Thanks for helping us out.

    • @pleasesirmorevideos4684
      @pleasesirmorevideos4684 3 ปีที่แล้ว +9

      he did not upload in the bit wise weekly contest when he came 12th :(

    • @vtvtify
      @vtvtify 3 ปีที่แล้ว +21

      Meanwhile Errichto uploading his last place rounds on topcoder..

    • @kueen3032
      @kueen3032 3 ปีที่แล้ว +10

      He came 3rd in weekly today's weekly contest 202. I don't understand how he did 3 questions in 3mins (easy, medium, medium) and 1 question in 6mins (hard) so total 9mins, and the ones who came 1st and 2nd did all 4 in 7 mins. How come people manage to read, think, code 4 questions including hard questions in just 7-9mins.

    • @pleasesirmorevideos4684
      @pleasesirmorevideos4684 3 ปีที่แล้ว +1

      @@kueen3032 it is all about practice the first two questions are extremely simple and the third one is simple binary search well known question.

    • @kishorprasad3817
      @kishorprasad3817 3 ปีที่แล้ว +3

      @@kueen3032 you can check his videos to realise abt speed, they have immense practice and are active on all coding platforms. Leetcode questions are comparatively easy as compared to codeforces..

  • @AaronHe
    @AaronHe 3 ปีที่แล้ว +192

    10:28 I enjoyed 6th place for one second.

    • @vancedstone
      @vancedstone 3 ปีที่แล้ว +8

      Hey that's still really good!

    • @AaronHe
      @AaronHe 3 ปีที่แล้ว +20

      @@vancedstone Yeah dude, I finished the third problem, looked on the leaderboard, and freaked out. Tried to solve problem 4 as fast as possible but failed.

    • @vancedstone
      @vancedstone 3 ปีที่แล้ว +5

      @@AaronHe Lol I would probably freak the heck out too and mess up the next problem.

    • @michaellakouadio6133
      @michaellakouadio6133 3 ปีที่แล้ว +2

      Hey, i want to learn how to code but don't know where to start. Do you have any tips? Thank you!

    • @rexgamingcsgoandmore4833
      @rexgamingcsgoandmore4833 3 ปีที่แล้ว

      damn bro good job

  • @teeksGG
    @teeksGG 3 ปีที่แล้ว +4

    I'm almost more impressed by how confident and quick you are on the keyboard. Someone can be just as smart as you but that ability to quickly input everything has to be a major advantage.

  • @harsh6390
    @harsh6390 3 ปีที่แล้ว +91

    bro you are an inspiration to me..the moment i submitted my first solution you had won the contest...

    • @de_vamp
      @de_vamp 3 ปีที่แล้ว +13

      And me at that time, was trying to even understand the problem

    • @nizz4m
      @nizz4m 3 ปีที่แล้ว +23

      @@de_vamp And me at that time, still searching at stackoverflow

    • @Cuberates
      @Cuberates 3 ปีที่แล้ว +7

      and me at that time, wondering if I'm in the right competition

    • @anmolsharma9539
      @anmolsharma9539 3 ปีที่แล้ว +11

      And me at time , thinking which is right language java or cpp

    • @akshanshthakur9235
      @akshanshthakur9235 2 ปีที่แล้ว +3

      And at that time, was born

  • @jacked_asian
    @jacked_asian 3 ปีที่แล้ว +32

    what a trooper to do this while mom vacuums

  • @GoldenLion5648
    @GoldenLion5648 3 ปีที่แล้ว +6

    Great job William! Have you heard of the advent of code? It is a series of coding problems with a story. There is a new problem with two parts released every day in December until Christmas. The old problems are still up if you want to try them/ make videos on them. Keep up the good work!

  • @harshaaravala2861
    @harshaaravala2861 ปีที่แล้ว +5

    I'm new to programming so I don't understand what he's doing at all but it's fun watching someone solve the hardest of questions with ease.

  • @omarabozein7015
    @omarabozein7015 3 ปีที่แล้ว

    Finallyyyyy a new viddd ! Legend thanks for sharing ur knowledge

  • @tylerxiao2656
    @tylerxiao2656 3 ปีที่แล้ว +31

    I am proud to be part of the William Lin Fan Club on Codeforces.

  • @pramodmehta8399
    @pramodmehta8399 3 ปีที่แล้ว +12

    Heyy william, i was on problem 2 when I saw that you have won the contest. I felt so happy at the moment that you have won.
    KEEP IT UP ....

  • @shariqshaikh5715
    @shariqshaikh5715 3 ปีที่แล้ว +5

    william lin can you please suggest us where should we practice more like we can become like you and make our problem-solving skills better?

  • @SergeDuka
    @SergeDuka 3 ปีที่แล้ว +8

    So basically, the code doesn't have to be efficient, the timing of submission is all that matters, right? I registered on Leetcode like a week ago and they sent me an invitation to this thing, so I'm trying to figure out what it's about. Also, I presume that Python (or C++ for that matter) would win over Java because the code is more concise hence less typing, right?

  • @Chiby5570
    @Chiby5570 3 ปีที่แล้ว +9

    William : Winning the Contest
    Also William : I don't think I did that well!

  • @cwagnello
    @cwagnello 3 ปีที่แล้ว +54

    William: I didn't do that well
    ... solves all 4 problems in 10 minutes.
    Everyone: o_O

    • @turuus5215
      @turuus5215 3 ปีที่แล้ว +5

      Asian culture

    • @chocho563
      @chocho563 3 ปีที่แล้ว +4

      rank 1: i didnt do that well

    • @mansi3042
      @mansi3042 2 ปีที่แล้ว

      What else he wants 😐
      I won't be able to solve a single problem in that time 😂

  • @xappppp
    @xappppp 2 ปีที่แล้ว

    I like this hardcore problem solving video, it could be more revealing than a prepared class.

  • @yihanlei9220
    @yihanlei9220 3 ปีที่แล้ว

    i waited for your video for a long time

  • @bohuazhang9145
    @bohuazhang9145 3 ปีที่แล้ว +1

    Congrats!

  • @user-pj3fs9yo1s
    @user-pj3fs9yo1s 3 ปีที่แล้ว +15

    I just finished the first problem when your solutions of all the problems were accepted😫😫😫

    • @TBasianeyes
      @TBasianeyes 3 ปีที่แล้ว +1

      you are still doing better than 95% of us

    • @folyplays-getgamified3613
      @folyplays-getgamified3613 3 ปีที่แล้ว +1

      @@TBasianeyes okay sorry to disturb but what exactly is this? Is this supposed for a certain age group or free for all? And what languages does it support?

    • @bmxguy418
      @bmxguy418 3 ปีที่แล้ว +2

      @@folyplays-getgamified3613 this is a contest on a website for problem solving training for people in the CS industry. You should learn algorithms, data structures and complexity analysis before diving into it. It supports all mainstream languages

    • @turuus5215
      @turuus5215 3 ปีที่แล้ว

      bmx guy How can I join this competition?

    • @folyplays-getgamified3613
      @folyplays-getgamified3613 3 ปีที่แล้ว

      @@bmxguy418 Thanks! Appreciate it man!

  • @manas_singh
    @manas_singh 3 ปีที่แล้ว +2

    This is the kind of content I like waking up to

  • @owenizedd2830
    @owenizedd2830 2 ปีที่แล้ว

    Damn the minimum number of non overlapping solution is really great.

  • @rexgamingcsgoandmore4833
    @rexgamingcsgoandmore4833 3 ปีที่แล้ว +3

    Hey william, you better upload a video on you winning Codeforces Round #663 (Div. 2), congrats !!

  • @minakshikudalkar557
    @minakshikudalkar557 3 ปีที่แล้ว +7

    I submitted my first solution at 10 mins, and you won the contest by then!!
    Congratulations :)

  • @pradeepkargwal511
    @pradeepkargwal511 3 ปีที่แล้ว +2

    Just think ,how calculations are going on in his mind

  • @vedanshbhardwaj6548
    @vedanshbhardwaj6548 2 ปีที่แล้ว

    Just imagining how long would your interview last !

  • @memesmacha61
    @memesmacha61 3 ปีที่แล้ว +1

    Can you please make competitive programming series

  • @deepraval3406
    @deepraval3406 3 ปีที่แล้ว +2

    Make a speedrun video on codechef past long challenges

  • @ClashwithAshishClashboy
    @ClashwithAshishClashboy 3 ปีที่แล้ว

    From where i start to learn advance topics like tree problems or graphs problems based on bfs or dfs........as i m not able to solve these type of problems in contests....kindly guide me

  • @grandparick3176
    @grandparick3176 3 ปีที่แล้ว +4

    For the love of God someone please tell me what keyboard he uses. Thank you.

  • @wthxrsh
    @wthxrsh 3 ปีที่แล้ว +4

    How he learnt programming I want to know that..?

  • @sihoonoh9021
    @sihoonoh9021 ปีที่แล้ว

    I don't know much about coding, so please correct me if I am wrong. For the cutting problem, can't you be more greedy with it? You compare each pair of partitions parted by the cuts, and the smallest pair gets cut last.And assuming the cut in this partition is now patched , repeat the same process and you get the second to last cut... and so on in this way you work backwards. I don't understand C code, but I am guessing from the fact you said dynamic programming ,the complexity is factorial, if you consider every single cut, and every single cut excluding the previous cut, and so on. Mine can be done in n+(n-1)+(n-2)+ =n^2, what is wrong with this?

    • @mfjww
      @mfjww 4 หลายเดือนก่อน

      Greedy is not correct, you have to consider every combination. And the time complexity of dynamic programming in the video is n^3

  • @yujianzhao6461
    @yujianzhao6461 3 ปีที่แล้ว +2

    I think for your solution to the first problem, in the worst case like 'abcdeEDCBA', you have to loop N times, which makes your algorithm O(N^2). I think it's easy to do it with O(N).
    Also, you don't have to use t as a backup of s.

    • @user-pj3fs9yo1s
      @user-pj3fs9yo1s 3 ปีที่แล้ว

      I used the stack to do the solution with O(N), but only the largest length of the string is 100, so you can just loop to maximize the time you spend at other problems even though it is an algorithm with O(n^2)

    • @Arunnn241
      @Arunnn241 3 ปีที่แล้ว

      Yeah there's definitely better ways, but in a competition with inputs that are going to be low in size, the fastest solution becomes the one you can type out the fastest.

  • @rohanpandey9957
    @rohanpandey9957 3 ปีที่แล้ว

    william lin bro which keyboard do use??

  • @gokul8747
    @gokul8747 3 ปีที่แล้ว +1

    can you make a prep guide on ioi

  • @cwagnello
    @cwagnello 3 ปีที่แล้ว +4

    How can you concentrate with the vacuum cleaner in the background??

  • @sorinica
    @sorinica ปีที่แล้ว +1

    hi! I saw you are using vim. Can you give me some links for configuring vim for windows? thanks

  • @abhigyanshrivastava1255
    @abhigyanshrivastava1255 3 ปีที่แล้ว +2

    4:22 why I never had to cast string.size() to 'int', but William is getting a Runtime error?

    • @samwisegamgee8502
      @samwisegamgee8502 3 ปีที่แล้ว +7

      size() returns unsigned int. So when size() is zero, size() - 1 becomes UINT_MAX instead of -1. It's one of the most annoying things.

  • @securityintech
    @securityintech 3 ปีที่แล้ว +5

    Why weren't you in Codejam finals?

    • @cogitoergosum7945
      @cogitoergosum7945 3 ปีที่แล้ว +11

      He's not at that level yet. He is still young and have a lot more to learn. If MIT does not take too much of his time this year, he will definitely be in the finals next year. btw He came 138 this year. It's quite a good achievement.

  • @yessirski7868
    @yessirski7868 ปีที่แล้ว

    How in the world does anyone get to this point? I would love to be able to go through problems like this.

  • @kaushik.aryan04
    @kaushik.aryan04 ปีที่แล้ว

    This guy solved this question in 4 minutes it took me 2 days to solve this (last one)

  • @deepanshuyadav4418
    @deepanshuyadav4418 3 ปีที่แล้ว +1

    why s.size() in the first question was needed to be typecasted to int ? Shouldn't size already return int value ?

    • @guzzo9000
      @guzzo9000 3 ปีที่แล้ว +1

      I think it is some weird data type, like std::size_type. Either that, or it's an unsigned int, or something. Idk for sure doe.

    • @miteshkumar5557
      @miteshkumar5557 3 ปีที่แล้ว +8

      You need to typecast it to (signed int) so that if the string is empty, it won't underflow to INT_MAX. s.size() returns an unsigned int dawg.

  • @giabao6462
    @giabao6462 ปีที่แล้ว

    i admire you so much

  • @vanshjoishar9218
    @vanshjoishar9218 3 ปีที่แล้ว

    oh my god you look so sleepy dayum!
    Still manage to win?
    WTH am i doing with my life?

  • @NotFound-hy7qb
    @NotFound-hy7qb 3 ปีที่แล้ว

    One request - You should post your solutions in discussion section of leetcode that would help alot

  • @user-yw7oh3ow7g
    @user-yw7oh3ow7g 3 ปีที่แล้ว +1

    William Make A Journey Video about your coding skills.....

  • @labgeek1559
    @labgeek1559 3 ปีที่แล้ว +1

    is someone vacuuming or just the video? :)

  • @chishikiendeavourer8663
    @chishikiendeavourer8663 7 หลายเดือนก่อน

    His solving ability is relevant to George Hortz😮

  • @sailaminoak
    @sailaminoak 3 ปีที่แล้ว +1

    Can you explain the last problem

  • @intellagent7622
    @intellagent7622 3 ปีที่แล้ว

    I just got this problem on Roblox OA yesterday LOL

  • @Xp-Sam
    @Xp-Sam 3 ปีที่แล้ว

    can anyone explain why he needed to typecast to int in question 1?

  • @AlexCarter881
    @AlexCarter881 3 ปีที่แล้ว +11

    Make Strings Great Again

    • @SergeDuka
      @SergeDuka 3 ปีที่แล้ว

      Yeah, I had the same thought. 😂😂😂

  • @anilkumarpelluri3795
    @anilkumarpelluri3795 3 ปีที่แล้ว

    Hey! What's ur goal?

  • @vamp7435
    @vamp7435 3 ปีที่แล้ว +3

    Hey William! I was wondering how you inverted the integers in the second question. Also, what does c^=1 do, and does it invert c?

    • @cbyitina4170
      @cbyitina4170 3 ปีที่แล้ว +6

      ^ means XOR, x ^ y -> return x == y ? 0 : 1;

    • @Piyush-yp2po
      @Piyush-yp2po 10 หลายเดือนก่อน

      It is xor operation, 1^1=0 and 0^1=1 , so it basically inverts

  • @shahidtauheed7553
    @shahidtauheed7553 3 ปีที่แล้ว +2

    Hey bro how r u ?

  • @samlawson7718
    @samlawson7718 3 ปีที่แล้ว +1

    How u do that soo fast

  • @tydical
    @tydical 3 ปีที่แล้ว +3

    It feels like when he is typing the video is at 2x and when speaking it's at 1x. When di youtube start tis feature?

  • @fuadf.7842
    @fuadf.7842 3 ปีที่แล้ว

    idk what is he doing but i still watch it till end tho

  • @springli7917
    @springli7917 3 ปีที่แล้ว +1

    so cool

  • @zoravier7549
    @zoravier7549 3 ปีที่แล้ว +2

    what for(int i=cuts.size() ; ~i; --i) what is ~i operrator can anyone explain.

    • @AustinHong-re1ij
      @AustinHong-re1ij 8 หลายเดือนก่อน

      It’s the bitwise not operator. When i becomes -1 it’s bit representation is set to all one and biteise not operator will turn it into 0 at which point the for loop terminates

  • @10minutesandunder
    @10minutesandunder 8 หลายเดือนก่อน

    how would he stack up vs tourist

  • @kumarshivam8077
    @kumarshivam8077 3 ปีที่แล้ว

    How many years have you invested on programming

  • @bunnyhop9798
    @bunnyhop9798 3 ปีที่แล้ว

    How to study for competitiv programming?

    • @renaldiatma7828
      @renaldiatma7828 3 ปีที่แล้ว

      @@cogitoergosum7945 thank you....

  • @cogitoergosum7945
    @cogitoergosum7945 3 ปีที่แล้ว +2

    Gennady is a beast!! It's time for him to retire now and change the world with his mind.

  • @trexbattle
    @trexbattle 3 ปีที่แล้ว +1

    Algo expert io ad but tht lisp dudes girl lookin veluctuous

    • @prakash_77
      @prakash_77 3 ปีที่แล้ว

      Did you mean voluptuous?

  • @anmolsaxena6630
    @anmolsaxena6630 3 ปีที่แล้ว +1

    Who are here after Love babbar video?

  • @brandish-so1rq
    @brandish-so1rq ปีที่แล้ว

    просто пришел и затащил игру

  • @amiteshsingh4165
    @amiteshsingh4165 3 ปีที่แล้ว

    OP

  • @srishtikdutta8946
    @srishtikdutta8946 3 ปีที่แล้ว +5

    Next Video -->Codechef long in 12 hours.

  • @HiPh0Plover1
    @HiPh0Plover1 3 ปีที่แล้ว

    u better fucking win google code jam next year , i mean tourist been winning for 7 years wtf

  • @WilliamYFeng
    @WilliamYFeng 3 ปีที่แล้ว +4

    Haha, problem 4 almost got me. I implemented a DP table in the last 2 minutes and it worked :D
    Reaction: th-cam.com/video/0ptrhPiinPw/w-d-xo.html

  • @perfectgamer9208
    @perfectgamer9208 3 ปีที่แล้ว +1

    Change colour of chrome

  • @fanaticalplel1003
    @fanaticalplel1003 3 ปีที่แล้ว +1

    This guy definitely has google and ibm and a whole lot of companies begging for him to work there

  • @knowledgepoint2124
    @knowledgepoint2124 3 ปีที่แล้ว +1

    Hey william, i have a question for you,
    How much had you scored in your 10th standard???

  • @svsrkpraveen
    @svsrkpraveen 3 ปีที่แล้ว +2

    I could only solve 2 problems in 1.5 hours :(

  • @marcosamuel17
    @marcosamuel17 3 ปีที่แล้ว

    Hello!

  • @user-gz6bg3kr2l
    @user-gz6bg3kr2l 3 ปีที่แล้ว

    兄弟你是怎么练习的呀,我也练习,但是和你的速度比起来差很多,有什么方法么?

  • @Warrior97489
    @Warrior97489 3 ปีที่แล้ว

    Why you upload only when you win? Pls upload regardless so that we can watch and learn. Thanks.

  • @VrickzGamer
    @VrickzGamer 3 ปีที่แล้ว +1

    please solve codechef AUGUST LONG CHALLENGE BROO

  • @mozammil4380
    @mozammil4380 3 ปีที่แล้ว

    kindly try to add a keyboard cam it will be great to watch you type at that speed..... beginners like my want to learn your style

  • @Felven
    @Felven 3 ปีที่แล้ว

    O.O

  • @pleasesirmorevideos4684
    @pleasesirmorevideos4684 3 ปีที่แล้ว +7

    can't you discuss the solutions also? otherwise there is no point in watching this

    • @snipersquanza1453
      @snipersquanza1453 3 ปีที่แล้ว

      He sometimes posts explanations to these types of problems, however he just posts these to show his coding process, but not in-depth because he needs to go quick.

    • @irdunno2204
      @irdunno2204 3 ปีที่แล้ว

      It's a contest, I don't think he would waste time explaining when the time is ticking.

    • @pleasesirmorevideos4684
      @pleasesirmorevideos4684 3 ปีที่แล้ว +1

      @@irdunno2204 i am talking about adding explainations after the contest ends.

    • @HDbIce-oj3wv
      @HDbIce-oj3wv 3 ปีที่แล้ว +1

      @@pleasesirmorevideos4684 I agree with you

    • @kevinrojas7665
      @kevinrojas7665 3 ปีที่แล้ว

      The best you can do is try this you own and when you've solved them or have a nice grasp of what happened see the videos. That way you'll now what's happening and understand his solutions

  • @cbyitina4170
    @cbyitina4170 3 ปีที่แล้ว

    I doubt he was already able to code when he was born.

  • @seqi1890
    @seqi1890 3 ปีที่แล้ว +1

    orz

  • @jhashivam28
    @jhashivam28 3 ปีที่แล้ว

    William 1 request plz plz plz plz
    Make atleast 1 vdo doing CP in java plz 🙏

  • @mc-nf7hd
    @mc-nf7hd 3 ปีที่แล้ว

    8th

  • @shubhmishra66
    @shubhmishra66 3 ปีที่แล้ว +1

    No views 3rd like

  • @danielchoi6128
    @danielchoi6128 3 ปีที่แล้ว +10

    First

  • @user-od7vs2fs2v
    @user-od7vs2fs2v 7 หลายเดือนก่อน

    he is just insane 🫥🫥man

  • @kunalaggarwal3867
    @kunalaggarwal3867 2 ปีที่แล้ว

    It took me 50 mins to come up with an approach and solve the last question and this guy solved that question within 3 minutes and still complained that he didn't do well in the contest.🥲

  • @seqi1890
    @seqi1890 3 ปีที่แล้ว

    orz