AlgoUniversity
  • Go Back
Discussion
Not Same Elements :

Author

Manas

Difficulty Level : Easy

Submissions : 276

Asked In : Morgan-Stanley

Marks :10

: 4 | : 2

You are given two lists of positive integers. Write an algorithm representing the number of elements in the two lists which are not common to both the lists.

Constraints :

1 <= n,m <= 100000

1 <= arr[i] <= 10^9

Example

Input

11

1 1 2 3 4 5 5 7 6 9 10

10

11 12 13 4 5 6 7 18 19 20

Output:

12

Explanation:

The numbers that are not common to both lists are [1, 1, 2, 3, 9, 10, 11, 12, 13, 18, 19, 20]

So, the output is 12.

Input

The first line of the input consists of an integer - *listinput1_size*, representing the number of elements in the first list(N).

The second line consists of N space separated integers representing the first list of integers.

The third list of an integer - *listinput2_size*, representing the number of elements in the second list(M).

The last line consists of M space-separated integers representing the second list of positive integers.

Output

Print a positive integer representing the count of elements that are not common to both the lists of integers.

Example

Input
11
1 1 2 3 4 5 5 7 6 9 10
10
11 12 13 4 5 6 7 18 19 20
Output
12

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.