Count Number of subsequences of the form a^i b^j c^k [Amazon]

Problem:

Find the number  of subsequences of the form aibjck, i.e., it consists of i number of  ’a’ characters, followed by j  i number of  ’b’ characters, followed by k  i number of  ’c’ characters where i >= 1, j >=1 and k >= 1 from a given string S.

 

Comments are closed.