In computer programming, naming conventions improve the readability of code by providing consistent rules for naming identifiers. This problem focuses on converting variable names from kebab-case to either camel-case or snake-case, depending on a given instruction.
Kebab-case: Words are separated by hyphens (-
).
Example: an-example-of-variable-name
.
Camel-case: The first letter of each word is capitalized and no separators are used.
For instance, the kebab-case an-example-of-variable-name
becomes AnExampleOfVariableName
.
Snake-case: Words are joined using underscores (_
).
For instance, the kebab-case an-example-of-variable-name
becomes an_example_of_variable_name
.
You are given a list of variables in kebab-case along with the creation time $t_i$ and a flag $o_i$ indicating the target naming convention:
Your tasks are:
CamelCase
and SnakeCase
classes so that they convert the given kebab-case variable name into the corresponding naming convention.Case
and its derived classes, CamelCase
and SnakeCase
. When a variable is deleted, the destructor should print:
Camel-case variable <VarName> created at time <CreateTime> is deleted
Snake-case variable <VarName> created at time <CreateTime> is deleted
Here <VarName>
is the converted variable name and <CreateTime>
is the time when the variable was created.
The first line contains an integer $N$, representing the total number of variables.
Each of the following $N$ lines contains:
For each variable, when the object is deleted, output exactly one line:
Camel-case variable <VarName> created at time <CreateTime> is deleted
Snake-case variable <VarName> created at time <CreateTime> is deleted