private static String sortCharacters(String string) {
		if (string == null)
			return null;
		
		char[] array = string.toUpperCase().toCharArray();
		
		char leftChar = 'A';
		char rightChar = 'Z';
		int index = 0;
		int left = 0;
		int right = array.length - 1;
		
		// 13 passes at most
		while (left < right) {
			while (index < right) {
				if (array[right] == rightChar) // special case if right is already a rightChar
					right--;
				else if (array[right] == leftChar) { // special case if right is a leftChar
					if (index == left)
						index++;
					array[right] = array[left];
					array[left++] = leftChar;
				} else { // normal case
					if (array[index] == leftChar) {
						array[index] = array[left];
						array[left++] = leftChar;
					} else if (array[index] == rightChar) {
						array[index] = array[right];
						array[right--] = rightChar;
					}
					index++;
				}
			}
			
			index = left;
			leftChar++;
			rightChar--;
		}
		
		return new String(array);
	}