Skip to content

Latest commit

 

History

History
12 lines (11 loc) · 277 Bytes

File metadata and controls

12 lines (11 loc) · 277 Bytes

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"