Input : str = "gfg"
Output : 7
The seven distinct subsequences are "", "g", "f",
"gf", "fg", "gg" and "gfg"
Input : str = "ggg"
Output : 4
The four distinct subsequences are "", "g", "gg"
and "ggg"
Count Distinct Subsequences
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||