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
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. :)
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.
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
Thanks for the Queue tip, it was helpful and soooo simple.
Thanks for very detailed explaination
thanks bhaiya
@ARYANMITTAL
16 күн бұрын
❤️❤️🫂
Thanks bhaiya... Maine sab utube channnels dekh liye iss question ke soln wale lekin aapke tarah kisi ne explain nii kiya...
Watched till 6:53. Learnt a queue, modulo and a list can ve used for cyclic problems
You are greattt!!!!
Exact Josephus problem
Excellent explanation
thank you!
Amazing explanation thank you so much
Thank you. Unfortunately I couldn't understand O(n) solution, I will try to watch the explanation more times
really difficult to come up with such intuition in hacker rank / interview rounds
why the loop start from 2 till
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
13 күн бұрын
i did using circular linked list ..it worked
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
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
14 күн бұрын
@@javiergonzalez3791 Thank you for the clarification
Bhai iss baar weekly ke solutions kyu nhi bnaye??
@ARYANMITTAL
16 күн бұрын
Bhai discord pr contest discussion pr dekho ❤️🫡
@anjalidwivedi2232
16 күн бұрын
@@ARYANMITTALBhaiyaa where to find discord link?
@ARYANMITTAL
14 күн бұрын
Ye lo ji ❤️ - kzread.info/dash/bejne/daeemJeKhLbIXZc.html
@ARYANMITTAL
14 күн бұрын
Desciption me mil jaaega
solving the question with the help of queue was easy... but coming up with the O(n) solution was hard...🫥🫥