Thiruttu pasanga 2
All submissions for this problem are available.
Sujatha, after becoming the CEO of a company, decided to grant some of his
books to his company’s employees for free! On one fine day, he asked all his
employees to form a line and he started distributing books. Sujatha will note
down the ID of the employee, when he gives the book. All his employees are die-
hard fans of Sujatha, hence they started cheating by collecting more than one
book. You have to find out the number of people who have cheated.
Sujatha has agreed to give some of his books to you, if you solve this problem.
(Come on! What are you waiting for :) )
First line contains the number of test cases T.
For each test case, first line would contain N which denotes the size of the ID list.
Next line will contain the IDs of employees in the ID list.
For each test case, output the number of employees who cheated.
Input: 2 3 1 1 2 3 1 2 3 Output: 1 0
Example case 1. Employee whose Id is 1 has got book twice. Hence he has
Example case 2. All employees have got book only once.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions