always come across your videos but never subscribed but it was consistently too good to not subscribe so you erned a subscriber keep doing amazing bro im a content creator myself and i can see the effort you put into these videos
Why are you mostly explaining most asked easy question just to pull out most of the audience you should explain medium questions BCS it is the truth that they are asked more then easy ones.
Master Data Structures & Algorithms For FREE at AlgoMap.io!
its statistically easier to get accepted to Harvard than to get hired by google
Lol it's depressing how tough it's to get a tech job in a good company nowadays
number of tech companies better than google is greater than the number of ivy leagues
Google?? Try any tech jobs rn
Yeah tbf the number of great companies are countless, compared to number of ivy leagues@@erek
BRO IS ON TO NOTHING🔥🗣
always come across your videos but never subscribed but it was consistently too good to not subscribe so you erned a subscriber keep doing amazing bro im a content creator myself and i can see the effort you put into these videos
best series
Great videos.
amazing vids
Bro, Pls update these problems in google sheet, so it would great and helpful
recursion version
t = 'abcde'
s = 'acd'
def is_subsequence_rec(s: str, t: str) -> bool:
if s[0] in t:
if len(s) == 1: return True
return is_subsequence_rec(s[1:], t[t.index(s[0]) + 1:])
else: return False
print(is_subsequence_rec(s, t))
In Python, two problems:
(1) The recursion limit is 1000.
(2) s[1:] isn't pointer arithmetic -- it actually copies s.
Javascript
let s='abc'
let t='ahgbc'
let final=''
for (let i=0;ival===s[i] ? final+=val:null)
}
console.log(final=== s)
if you're using python wouldn't it be faster to use regex or is that not allowed here?
Generally not allowed. But good idea, how would you write it using a regex ?
@@davidespinosa1910 ".*".join(s). That's your regex prompt
Why are you mostly explaining most asked easy question just to pull out most of the audience you should explain medium questions BCS it is the truth that they are asked more then easy ones.
Say is it 1) A B C
2)BAC then will A get missed out?
Agreed, but I guess you cam just sort them beforehand to make sure its in alphabetical order
I think your logic is a bit flawed, what if there are 2 A's , like aghabjkabc
This won't work
It works. It's a subsequence not a substring.
@@codingparas thanks for clarifying, my bad 😅