Is Subsequence (LeetCode 392) | Full Solution with subsequence definition and examples

preview_player
Показать описание

Chapters:
00:00 - Intro
00:53 - Problem statement and description
03:10 - What is a subsequence & Brute Force approach
07:26 - Efficient solution (Two Pointer approach)
10:09 - Dry-run of Code
12:38 - Final Thoughts

📚 Links to topics I talk about in the video:

📖 Reference Books:

🎥 My Recording Gear:

💻 Get Social 💻

#leetcode #programming #interview
Рекомендации по теме
Комментарии
Автор

reason why i love your DSA solutions is that you teach how to solve the problem, not just solving the problem

toheebalawode
Автор

You are a legend, please keep making these, genuinely the only youtube I can follow along and understand. Keep going!!!

htsn
Автор

This Channel is a pure Gold Found this few days back and really helpful

souvikmukherjee
Автор

great work .Thanks for solving the problem from scratch

SrimathiN-spyr
Автор

hey nikhil, all text based solution links are navigating to random page, can u pls check on that, it was working fine earlier

unemployedcse
Автор

hello sir would you please make a video on subsequence using recursion for example if we have an arr = [1, 2, 3] output = ans = [[], 1, 2, 3, [1, 2][2, 3], [1, 3][1, 2, 3]]

sachinpatel
Автор

In the two pointer approach, I did not understand one thing the ordering also has to be checked in a subsequence which is missing for the problem in the testcases, for instance here s = "acg" and t = "ahbgdc", they are considering s as a subsequence of t which should not be so, as the ordering is not maintained, although all elements are present from s in t. Please explain this once, because in your code as well the ordering part is not covered.

anutoshghosh
Автор

let sunsequence=(str1, str2)=>{
let fam=[]
for(let i = 0; i<=str1.length-1; i++) {
for(let j = 0; j<=str2.length-1; j++) {
if(str1[i]==str2[j]){

fam.push(str2[j])
}




}
}
return
}
console.log(sunsequence('cde', 'abcde')); ...javascript

jegankingmaker