Count Assignments to Same Variable

Python Medium 2 views
Back to Questions

Problem Description

You will receive n lines like 'x = value'. Count how many times the same variable name appears again (2nd time onwards). Output count.

Input Format

First line n. Next n lines assignments.

Output Format

One integer count.

Sample Test Case

Input:
5 a = 1 b = 2 a = 3 c = 4 a = 5
Output:
2

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next