#125

  Рет қаралды 3,198

Placements Ready with Avinash

Placements Ready with Avinash

Күн бұрын

Пікірлер: 17
@52nevil36
@52nevil36 Жыл бұрын
thanks bro
@eklavya22k34
@eklavya22k34 Жыл бұрын
Thanks for explaining , code is simple, only understanding is the main part. It will be nice if u could explain 2 examples separately by making a full dig. from starting till all subsequences are covered. Once ex. is understood, code is doable if anyone has covered the basic. Thanks again. Tc.
@PlacementsReady
@PlacementsReady Жыл бұрын
Ok thanks for the suggestions
@abhishekkumar-gi5xm
@abhishekkumar-gi5xm Жыл бұрын
it is not necessary to make us understand in english ... hindi me smjhate to aacha rehta.. aur aache se smjh me aata
@PlacementsReady
@PlacementsReady Жыл бұрын
Where u faced the issue ?
@HarshGuptaNITP
@HarshGuptaNITP Жыл бұрын
why you subtracted dp[index-1]? as the answer is stored in in dp[index]as dp[0]=1, dp[1]=2 so you are following one based indexing
@PlacementsReady
@PlacementsReady Жыл бұрын
We need to ignore the subsequence that contains that character that is why index-1
@sushantsuman4329
@sushantsuman4329 Жыл бұрын
why ggf output is 6 and gfg is 7? both are same
@PlacementsReady
@PlacementsReady Жыл бұрын
Do a dry run according to algo u will understand
@nithinn2632
@nithinn2632 Жыл бұрын
in string "gfg", why "ggf" and "fgg" is not a substring?
@rainywinter459
@rainywinter459 Жыл бұрын
We are finding subsequences not substring
@PlacementsReady
@PlacementsReady Жыл бұрын
Bro by mistake I told substring while explaining
@PlacementsReady
@PlacementsReady Жыл бұрын
Order should be followed that's why ggf and fgg is not a subsequence
@ScaraB01
@ScaraB01 Жыл бұрын
Can u tell in python
@piyushverma1303
@piyushverma1303 Жыл бұрын
def distinctSubsequences(self, s): dp=[0]*(len(s)+1) dp[0]=1 mp={} for i in range(1,len(s)+1): dp[i]=2*dp[i-1] if s[i-1] in mp: dp[i]=(dp[i]-dp[mp[s[i-1]]-1])%1000000007 mp[s[i-1]]=i return dp[len(s)]
@PlacementsReady
@PlacementsReady Жыл бұрын
For reference Java and python code is attached in description of video
#126 GFG POTD Column name from a given column number GeeksForGeeks Problem of the Day
6:55
Placements Ready with Avinash
Рет қаралды 1,6 М.
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 173 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 8 МЛН
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 12 МЛН
44  Example class
21:22
Coder MCA wallah
Рет қаралды 2
DP 32. Distinct Subsequences | 1D Array Optimisation Technique 🔥
40:15
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 105 МЛН
#127 GFG POTD Roman Number to Integer GeeksForGeeks Problem of the Day
6:01
Placements Ready with Avinash
Рет қаралды 1,1 М.
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1,1 МЛН
#99 GFG POTD, Count number of substrings solution | Puneet Kumar IIITD
22:04
Puneet Kumar IIITD
Рет қаралды 4,2 М.
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН