OakNorth Bank | OA 2019 | Bilbo and Books
Anonymous User
479
Dec 13, 2019
Dec 14, 2019
Bilbo likes collecting different types of books and reading them whenever he gets time out of his busy schedule. One day Bilbo decided to make groups of books such that each group contains exactly one book of each type and gift each group to one of his friends. Bilbo is wondering how many different groups can he make?
Input format:
First line contains an integer N<=100000.
Second line contains N space separated integers where integer at index i represent the type of book i.
Output Format:
One integer that is number of different groups Bilbo can make.
Sample Input 1:
7
2 4 2 4 3 2 3
Sample Output :
2
Explanation:
Clearly Bilbo can make 2 sets of {2,3,4}
Sample Input 2:
2
1 2
Sample Output 2:
1
Comments (1)

