Interview question

You have a string S of length N consisting of non-negative integers. Write a program to find how many arrays could have S as an output?

Sample Input
7 1234567 9

Sample Output

It can be solveable with dp[N][log_{2}C].

Can you share the solution.I am not able to solve it.
This will help me a lot

How can I trust you that this does not belong to a live contest!

Solved it.
Anyways, Thanks for your help