Lexical Analyzer
Practice
2.8 (12 votes)
Ad Hoc
Easy
String manipulation
Approved
Problem
29% Success 5792 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Alex has recently decided to learn about how to design compilers. As a first step he needs to find the number of different variables that are present in the given code.

So Alex will be provided N statements each of which will be terminated by a semicolon(;). Now Alex needs to find the number of different variable names that are being present in the given statement. Any string which is present before the assignment operator denotes to a variable name.

Input Format: :

The first line contains a single integer N.

Each of the next N lines contains a single statement.

It is guaranteed that all the given statements shall be provided in a valid manner according to the format specified.

Output Format: :

Print the number of different variable name that are present in the given statements.

Constraints: :

\( 1 \le N \le 10^5 \)

\( 1 \le |Statement| \le 100\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
10 votes
Tags:
AlgorithmsEasyImplementationPriority queueString Manipulation
Points:20
16 votes
Tags:
AlgorithmsEasyString Manipulation
Points:20
553 votes
Tags:
Ad-HocApprovedBasic ProgrammingEasyOpenReady
Editorial

No editorial available for this problem.