Find Distinct Elements

easy
1.Given a N x N matrix. 2.You have to find count of all the distinct elements common to all rows of the matrix. 3.Your task is to complete the function count() which should return the count of all distinct elements common to all rows of the matrix.

Input Format

1.First line contains an integer 'N' denoting the size of the 2-d array. 2.Second line contains N*N space separated elements of the the 2-d array

Output Format

Return the count of all distinct elements common to all rows of the matrix.

Constraints

1 <= N <= 1000

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
4
2 1 4 3 1 2 3 2 3 6 2 3 5 2 5 3
Output
2
Previous
Find Common Characters
Next
Find All Four Sum Numbers

Related Questions