Given two strings S and T, find count of distinct occurrences of T in S as a sub-sequence. Your task is to complete the function **subsequenceCount** which takes two strings as argument S and T and returns the count of the sub-sequences.

**Input:**

The first line of input contains an integer t denoting the no of test cases . Then t test cases follow. The first line of each test case contains 2 strings S and T.

**Output:**

For each test case in a new line print the count of distinct occurrences of T in S as a sub-sequence.

**Constraints:**

1<=t<=100

1<=length of (S,T)<=100

**Example(To be used only for expected output):
Input**

2

banana ban

geeksforgeeks ge

3

6

(i) For first test case S = banana, T = ban there are 3 sub-sequences which are [ban], [ba n], [b an].

(ii) For second test case S = geeksforgeeks, T=ge there are 6 sub-sequences which are [ge], [ ge], [g e], [g e] [g e] and [ g e].

**Note:**The **Input/Ouput** format and **Example** given are used for system's internal purpose, and should be used by a user for **Expected Output** only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.

Author: Shubham Joshi 1

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

madhursengar24 | 86 |

PiyushPandey4 | 617 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 448 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.