Please implement a data structure to efficiently support four operations:
I
:
Inserts the string
into
.
No changes are made if
is already in
.
E
:
Erases the string
from
.
No changes are made if
is not in
.
C
:
Counts the number of strings in
that end with the suffix
.
R: Resets
,
that is, removes all strings from
.
Input consists of several operations over an initially empty . Assume that each is made up of between 1 and 100 lowercase letters. At no moment the sum of the sizes of the strings stored in will be larger than .
Print the result of each C
operation, and three dashes for each R operation.
Author: Salvador Roura
Generation: 2026-01-25T12:17:14.793Z
© Jutge.org, 2006–2026.
https://jutge.org