Skip to content

Latest commit

 

History

History

Count Distinct Subsequences

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given a string, find the count of distinct subsequences of it.

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"