##
Number of subsequences of the form a^i b^j c^k
March 27, 2017

Given a string, count number of subsequences of the form aibjck, where i >= 1, j >=1 and k >= 1. Note: Two subsequences are considered different if the set of array indexes picked for the 2 subsequences are different. Expected Time Complexity : O(n) Examples: Input : abbc Output : 3 Subsequences are abc,… Read More »