K-th Symbol in Grammar | Recursion | Recurrence Relation Explained | GOOGLE | Leetcode - 779

preview_player
Показать описание
This is the 1st Video on our Recursion Playlist.
In this video we will try to solve a strange Recursion Problem - K-th Symbol in Grammar (Leetcode-779).
There are other ways to solve this problem, if you guys want more solution videos on this problem, kindly let me know through comment.

I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.

Problem Name : K-th Symbol in Grammar
Company Tags : GOOGLE

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook
Рекомендации по теме
Комментарии
Автор

i guess recursion is the hardest and the easiest topic simultaneoulsy...jb smjh aata h to kya hi smjh aata ha..aur jb ni aata to poora upar se jata h ....thanks bhaiya

khitijkarmakar
Автор

Came here from your "Find the K-th Character in String Game II " video.
I was able to solve this. All thanks to you MIK

gui-codes
Автор

Nobody explains so smoothly like you. When I come to your channel for solution after trying all the ways, I just expect a solution of an EASY question, no matter what is the level of the question on leetcode.😄

Ashwin_Dhuriya
Автор

We can also use mid = 2**(n-2)

nice explanation it's hard to do this during the interview,

recursion is one the topic is very hard before solving but cup of tea after realizing it

krunalkp
Автор

I'm solving recursion, dp problems bcoz of ur depth explanation.
Please provide weekly contest solutions too, it would be greatful .
Thank u

PranayMacharla-tucn
Автор

My mind after seeing explanation " bhai aapka knowledge to kaamal ka hai" .

bossmemes
Автор

Very good teaching with details 😮😊😊😊😊😊😊

ziauddinzira
Автор

Muje yahi solution samaj ata he!! Thank you so much for explaining this very well!

Sandythecoder
Автор

Brute force hua, Sir I relate problem with bucket water jo abhi past me aya tha also find repeat case etc but unfortunately stuck from last 2 hours thx for today problem 😊😊

AnkitSingh-tmdp
Автор

Bro you explained it very well even I watched Aditya verma but didnt understand then I watched yours.Now I completely understood. Thanks bro

nextgensolver
Автор

Thank you so much for this legit explanation. You are just out of the world

FanIQQuiz
Автор

i was trying to solve it using recursion similar to count and say problem..but this qn was completely different i liked the idea behind this question. Thank you bhaiya understood!

keertilata
Автор

you are a magician. loved the explanation.

wearevacationuncoverers
Автор

Hey there!
Your video explanations are damn amazing !!
I request you to also start making the solutions of the weekly and biweekly leetcode contest solution.
It will help a lot.

de_coder
Автор

Thank You for helping me out mik bhaiya.

anshukmishra
Автор

sir please upsolve contest of leetcode && start a series of competitive programming

I can do medium leetcode but can't do a single in codeforces

TrishitChar-wfqw
Автор

Thank you for the amazing explanation 🥰❤

anonymous
Автор

I was able to do brute force, also tried to solve using recursion after reading that the current solution was dependent on previous one, but unable to write the recursive function parameter for 'n' and 'k.
Loved your solution ❣

mohitrathore
Автор

Day 33
I understand what I want to do but it gets difficult to covert to code

ManaswiRane
Автор

class Solution {
public:
int f(int n, int k ){
if(n == 1){
return 0;
}

int temp = f(n-1, (k+1) / 2);

if(temp == 1){
if(k%2 == 0){
return 0;
}
return 1;
}
else{
if(k%2 == 0){
return 1;
}
return 0;
}
}


int kthGrammar(int n, int k) {
return f(n, k);
}
};

tsukuruuu
visit shbcf.ru