Given an input stream of N integers (alongwith the operation on these integers), the task is to print the number of the distinct elements in the stream after each operation.
There can be two types of operations that can be performed:
Addition represented by A.
Deletion represented by R.
First line of the input contains an integer T denoting the number of test cases. Then T test case follows. First line of each test case contains an integer N denoting the number of operations to be performed on a stream. Next N lines two space separated elements, the operation to be performed and the key element.
For each operation output the number of the distinct characters in a stream on a new line.
R 2 Output: