Cat Carol wants to invite some of her friends to a lunch at her house.
Carol has some chopsticks of possibly different lengths.
Each of the invited guests must receive two chopsticks.
Additionally, the two chopsticks given to each guest must have exactly the same length.
You are given a int length.
Each element of length is the length of one of Carol's chopsticks.
Compute and return the maximum number of friends Carol may invite.
|Method signature:||int getmax(int length)|
|(be sure your method is public)|
|-||length will contain between 1 and 50 elements, inclusive.|
|-||Each element of length will be between 1 and 100, inclusive.|
|Two chopsticks have the same length. Carol can invite one friend.|
|Carol can make one pair of chopsticks of length 1, two pairs of chopsticks of length 2, and one pair of chopsticks of length 3. She can invite four guests in total.|
|Carol has only one chopstick. Carol can't invite anybody.|
|No two chopsticks have the same length. Carol can't invite anybody.|
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.