# Distinct Occurences

Moderate
0/80
Average time to solve is 15m
Contributed by

## Problem statement

You are given two strings 'A' and 'B' of length 'N' and 'M' respectively, your task is to find the number of distinct occurrences of string 'B' in the string A as a subsequence.

Note:
``````1. A subsequence is a sequence generated from a string after deleting some characters of string without changing the order of remaining string characters.

2. 'A' and 'B' will be non-empty strings.
``````
Detailed explanation ( Input/output format, Notes, Images )
Constraints:
``````1 <= T <= 100
1 <= M, N <= 100

Time limit: 1 sec
``````
##### Sample Input 1:
``````2
12 3
codingninjas
cij
2 1
aa
b
``````
##### Sample Output 1:
``````2
0
``````
##### Explanation of Sample Output 1:
``````In test case 1, Possible subsequences are: [c  i     j  ], [c      i j  ].

In test case 2, There is no possible subsequence.
``````
##### Sample Input 2:
``````2
4 2
abcd
ac
6 3
banana
ban
``````
##### Sample Output 2:
``````1
3
``````
##### Explanation of Sample Output 2:
``````In test case 1, Possible subsequence is: [a c ].

In test case 2, Possible subsequences are: [ban], [ba  n ],[b   an ].
``````
Console