1823. Find the Winner of the Circular Game | Queue | Recursion | Math | 3 Approaches

In this video, I'll talk about how to solve Leetcode 1823. Find the Winner of the Circular Game | Queue | Recursion | Math | 3 Approaches
Math Similar Tricks:
Problem1 - • 3178. Find the Child W...
Problem2 - • 1518. Water Bottles | ...
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
Timeline:
0:00 - Bakwas
1:22 - Queue Approach (Similar to List/Vector/Array Approach)
6:12 - Recursive Approach
16:00 - Iterative Approach
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 29

  • @myvinbarboza3038
    @myvinbarboza303814 күн бұрын

    Say we have k=2 [F0,F1,F2,F3,F4]{0,1,2,3,4} 1) we kill the 1st index as 0+2-1(startindex+k-1) = [F2,F3,F4,F0]{0,1,2,3} F2's new index is curIndex-K for n-1 array so if we want the index for F2 in n it would be curIndex+k hence solve(n,k)= (solve(n-1,k)+k)%n The modulo is just used to get it in bounds I did not get this looking at other videos you explained it perfectly and this is what I learned. Thank you. :)

  • @selfsigma9764
    @selfsigma976416 күн бұрын

    You become a person for me which gives best explaination with reason. After watching you, I becomes sure that I haven't missed any aspect and approach of the problem to look another person's explaination. Please keep it up. And also do recommend the similar problem to look after.

  • @mohammedansil2302
    @mohammedansil230216 күн бұрын

    Brother your video helped me to get uo to the hr round atleast even then i got rejected still i passed the dsa round beacause of your daily leetcode solving

  • @ShubhamSharma-sf8wk
    @ShubhamSharma-sf8wk16 күн бұрын

    Thanks for the Queue tip, it was helpful and soooo simple.

  • @JayRamNai
    @JayRamNai15 күн бұрын

    Thanks for very detailed explaination

  • @darshanvanjara
    @darshanvanjara16 күн бұрын

    thanks bhaiya

  • @ARYANMITTAL

    @ARYANMITTAL

    16 күн бұрын

    ❤️❤️🫂

  • @TusharBharatRevagade
    @TusharBharatRevagade16 күн бұрын

    Thanks bhaiya... Maine sab utube channnels dekh liye iss question ke soln wale lekin aapke tarah kisi ne explain nii kiya...

  • @sivalokesh3997
    @sivalokesh399716 күн бұрын

    Watched till 6:53. Learnt a queue, modulo and a list can ve used for cyclic problems

  • @amitpandey9610
    @amitpandey961015 күн бұрын

    You are greattt!!!!

  • @codecode855
    @codecode85516 күн бұрын

    Exact Josephus problem

  • @raviroy84
    @raviroy8416 күн бұрын

    Excellent explanation

  • @alenscaria1516
    @alenscaria151616 күн бұрын

    thank you!

  • @saisree04
    @saisree0416 күн бұрын

    Amazing explanation thank you so much

  • @IK-xk7ex
    @IK-xk7ex16 күн бұрын

    Thank you. Unfortunately I couldn't understand O(n) solution, I will try to watch the explanation more times

  • @codedesigner8839
    @codedesigner883916 күн бұрын

    really difficult to come up with such intuition in hacker rank / interview rounds

  • @harshit-q8x
    @harshit-q8x16 күн бұрын

    why the loop start from 2 till

  • @abirbanerjee839
    @abirbanerjee83916 күн бұрын

    Solved it easily using queue...but firstly I tried to solve it using circular linked list as it came to my mind first and I thought it was the most appropriate approach to solve this one. The circular way of traversing, the deletion of a particular element, all suggested to use a circular ll. But it threw a run time error. Was I initially right in my logic?

  • @mohammadsohail1634

    @mohammadsohail1634

    13 күн бұрын

    i did using circular linked list ..it worked

  • @Sandeep-tn8mz
    @Sandeep-tn8mz15 күн бұрын

    BroI coudnt quite get your Stack Approch. @4:22 you are Pushing an item and popping it in very next line. I don't understand how it worked for you!!! Or should that be pop(0) ?? because I am coding it In python. After appending , the very next line the pop operation is removing last item which I just added.

  • @javiergonzalez3791

    @javiergonzalez3791

    14 күн бұрын

    The thing is that he is not using a stack, he is using a queue, so it works as FIFO (first in, first out). In this case he adds the element to the end of the queue, and he removes the element that is in the first position. Since you are using python, you should use pop(0) to indicate that you want to remove the first element, otherwise it would remove the last element as you have described

  • @Sandeep-tn8mz

    @Sandeep-tn8mz

    14 күн бұрын

    @@javiergonzalez3791 Thank you for the clarification

  • @Ayush37262
    @Ayush3726216 күн бұрын

    Bhai iss baar weekly ke solutions kyu nhi bnaye??

  • @ARYANMITTAL

    @ARYANMITTAL

    16 күн бұрын

    Bhai discord pr contest discussion pr dekho ❤️🫡

  • @anjalidwivedi2232

    @anjalidwivedi2232

    16 күн бұрын

    ​@@ARYANMITTALBhaiyaa where to find discord link?

  • @ARYANMITTAL

    @ARYANMITTAL

    14 күн бұрын

    Ye lo ji ❤️ - kzread.info/dash/bejne/daeemJeKhLbIXZc.html

  • @ARYANMITTAL

    @ARYANMITTAL

    14 күн бұрын

    Desciption me mil jaaega

  • @naamnhibataunga5897
    @naamnhibataunga589716 күн бұрын

    solving the question with the help of queue was easy... but coming up with the O(n) solution was hard...🫥🫥