There is a string with length n ≤ 104.
Let us denote fi as number of occurrences of the i'th unique sub sequence.
We need to calculate . Sub sequence does not have to be consective.
I have no idea about the solution so far. So any help would be appreciated.
Here is the source of the problem : link