@@ -0,0 +1,1026 @@
+// https://community.topcoder.com/stat?c=problem_statement&pm=11628%0A%0Apublic class CheatingQuiz %7B%0A%09public static int%5B%5D howMany(String answers) %7B%0A%09%09int optionCount = 0;%0A%09%09%0A%09%09/*%0A%09%09 * Number of frequencies of the letter %0A%09%09 * - 'A' (index 0), %0A%09%09 * - 'B' (index 1), %0A%09%09 * - 'C' (index 2) %0A%09%09 * in %22answers%22%0A%09%09 */%0A%09%09int%5B%5D letterFrequencies = new int%5B3%5D;%0A%09%09for (int i = 0; i %3C answers.length(); ++i) %7B%0A%09%09%09int letterIndex = answers.charAt(i) - 'A';%0A%09%09%09boolean isFirstOccurrenceOfLetter = (letterFrequencies%5BletterIndex%5D == 0);%0A%09%09%09if (isFirstOccurrenceOfLetter) %7B%0A%09%09%09%09optionCount++;%0A%09%09%09%7D%0A%09%09%09letterFrequencies%5BletterIndex%5D++;%0A%09%09%7D%0A%09%09%0A%09%09int%5B%5D numberOfOptions = new int%5B answers.length() %5D;%0A%09%09for (int i = 0; i %3C numberOfOptions.length; ++i) %7B%0A%09%09%09numberOfOptions%5Bi%5D = optionCount;%0A%09%09%09int letterIndex = answers.charAt(i) - 'A';%0A%09%09%09letterFrequencies%5BletterIndex%5D--;%0A%09%09%09boolean isLastOccurrenceOfLetter = (letterFrequencies%5BletterIndex%5D == 0);%0A%09%09%09if (isLastOccurrenceOfLetter) %7B%0A%09%09%09%09optionCount--;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09return numberOfOptions;%0A%09%7D%0A%7D%0A

Create CheatingQuiz.java