Subsequence of a String
A subsequence is a sequence that can be derived from another sequence by removing zero or more elements, without changing the order of the remaining elements.
More generally, we can say that for a sequence of size n, we can have (2n-1) non-empty sub-sequences in total.
For example, Consider the string “geeks”, there are 15 sub-sequences.
They are:
g, e, e, k, s,
ge, ge, gk, gs, ee, ek, es, ek, es, ks,
gee, gek, ges, gek, ges, gks, eek, ees, eks, eks,
geek, gees, eeks,
geeks