Decoded String at Index | Clean Code | TCS | GOOGLE | ORACLE | Leetcode - 880

preview_player
Показать описание
This is the 21st Video on our strings Playlist.
In this video we will try to solve a very good Problem - Decoded String at Index (Leetcode-880).

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 : Decoded String at Index
Company Tags : National Instruments, Oracle, Google, TCS

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

#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
Рекомендации по теме
Комментарии
Автор

*** SEE THE LATEST COMMENT IN THIS THREAD FOR DETAILED EXAMPLE ON INTUITION ***
Hi everyone, if anyone is wondering why k == 0 we get answer,

Actually k == 0 signifies that we have reached at the string which is being duplicated (because it’s divisible) by exactly K.
Now we are safe to say that the character are at is the answer.
This qn would have been simple if the inputs were always of the form : “abc2”, in such case we could simply find the character by doing the mod one time.

BUT, the tough part is that we can have more in input like “abc2a3” etc.
This calls for checking modulo every-time for different string sizes.

Hope this clears.
But I would want you to do a dry run on some more examples which are of the form :
Example :
1) “xyz2”
2) “xyz2ab3”
Compare both types and you will get more clarity.
Thank you so much for watching my videos ❤❤❤❤🙏🙏🙏😇😇😇😇

codestorywithMIK
Автор

Please continue the "Graph concepts and question " series, I am eagerly looking forward to more content from you, especially considering the dynamic nature of the tpoic. The insights and perspectives you offer are truly valuable, and I believe that continuous updates would greatly benefit your audience, including myself 🙂.

himeshbaraik
Автор

You are literally the one stop solution to absolutely any problem. I wish I could million subscribers and likes to this channel. Thanks guruji

thefinalfit
Автор

I think this is the best explanation I found for this video. I wasted hours trying to figure out the approach but seems that it's really a weird Qn. Salute to you for making it this easy. I read the Pinned comment, the examples cleared everything

wearevacationuncoverers
Автор

A type of intuition to observe this problem:
General observation : Any answer would be from the characters present in the decoded string.
It must be ended on any one character of string : 100% confirm
Therefore if we check the validity of each character to be the required character at the end by checking its repetition with the help of modulo then it is the good way to solve the problem.

Why backward loop ?
Reason: Accumulate total size of string till the character and see if its repetition is giving it as last character of decoded string.

Why always it is possible for any one character ?
Reason: Contraints that k < total decoded string => you do not have to worry about repetitions after that just focus till current character and then check the modulo condition.

There still might be some confusion after this but I think majority of questions related to intuition might be cleared.

Thankyou Sir and all : )

siddhantpatil
Автор

Tough one for me didn't get the intuition but now it's clear👍

rohitshah
Автор

Watched many videos and this is the best explanation i found. Thanks a lot again

AlishaKhan-wwio
Автор

Good explanation i have seen many solution today but able to understand and visualize only your approach

abhishekgoyal
Автор

Thank you so much. Finally it's clear to me. Watched the middle part twice and read the Pinned comment. Nailed it.

FanIQQuiz
Автор

You are the best teacher. thanks a lot bro/sir/mentor...

sahxzm
Автор

The best explanation i could ever find

mohithadiyal
Автор

Sir se approach saamjha or code karlia ❤❤❤ love u sir

sonumondal
Автор

this is reversal traversal.
1.loop start from left to k on string. if string is char.length++.if digit length *digit. to reach to k.
2.now reveals traverse .if find digit. k
length/ by digit and k%by length.
3.if(k==0||k==length).
return char.else return " ".
thanks for explaining and intuition 🎉❤

dayashankarlakhotia
Автор

took me some time to grasp. however, loved the question after understanding the solution

taneyasoni
Автор

Doubt :
Jab 12:19 par k ki value upadate hokar k=1 ho gayi thi to fir 13:13 par aapne k%size calculate karte hue k=5 kyu put kiya usme 🙄

Same confusion hua 2nd dry run kiya usme bhi...

adarshrathore
Автор

This channel a blessing. Thank you so much ❣

souravjoshi
Автор

Hii Bhaiya, there is a small request if possible could u please add a segment at the last of every video where you tell us about what we learn from the question like any pattern that we should remember or any key things that we should keep in mind so that when we encounter any similar type of question in future we can attempt them easily

kunal
Автор

hi great explanation 👍 A bit tricky problem though

Pratibha-wfqg
Автор

Unable to came up with the logic watched your video understood ❤

sachinmohanty
Автор

Sir please complete mcm and remaining topics of dp explanation playlist please. And sir what about the course launch we are waiting please sir.We are dependent on u only.

CodeWithBacky
welcome to shbcf.ru