#K64327. Unique Character Count
Unique Character Count
Unique Character Count
You are given a string s of length n consisting of lowercase English letters. Your task is to determine the number of unique characters in the substring of s from index 0 to index i (both inclusive) for each index i and output the counts.
For example, if s = "ababa", then the results are: [1, 2, 2, 2, 2].
The formula used to compute the result at each position i can be described as follows:
$$\text{result}[i] = \#\{s[j] : 0 \leq j \leq i\}\,.$$
Input is provided via standard input and output should be printed to standard output.
inputFormat
The first line of input contains an integer n, representing the length of the string.
The second line contains the string s composed of lowercase English letters.
outputFormat
Output a single line with n space-separated integers where the i-th integer represents the number of unique characters in the substring s[0...i].
## sample5
ababa
1 2 2 2 2