public long getSumOfMostCommonValues(int[] result) {

		if (result == null || result.length == 0)
			return 0;

		quickSort(0, result.length - 1, result);

		int maxCount = 1;
		int count = 0;
		int base = result[0];
		int number = base;
		for (int i : result) {
			if (base == i)
				count++;
			else {
				if (count > maxCount) {
					maxCount = count;
					number = base;
					base = i;
				}
				count = 1;
			}
		}
		return maxCount * number;
	}