package LeetCode;

public class ExcelSheetColumnNumber {
	public int titleToNumber(String s) {
		int res = 0;
		int stringLength = s.length();
		for (int i = stringLength - 1; i >= 0; i--) {
			res += ((s.charAt(i) - '@') * Math.pow(26, (stringLength - i - 1)));
		}
		return res;
	}

	public byte toByte(Character n) {
		switch (n) {
		case 'A':
			return 1;
		case 'B':
			return 2;
		case 'C':
			return 3;
		case 'D':
			return 4;
		case 'E':
			return 5;
		case 'F':
			return 6;
		case 'G':
			return 7;
		case 'H':
			return 8;
		case 'I':
			return 9;
		case 'J':
			return 10;
		case 'K':
			return 11;
		case 'L':
			return 12;
		case 'M':
			return 13;
		case 'N':
			return 14;
		case 'O':
			return 15;
		case 'P':
			return 16;
		case 'Q':
			return 17;
		case 'R':
			return 18;
		case 'S':
			return 19;
		case 'T':
			return 20;
		case 'U':
			return 21;
		case 'V':
			return 22;
		case 'W':
			return 23;
		case 'X':
			return 24;
		case 'Y':
			return 25;
		case 'Z':
			return 26;
		default:
			return 0;
		}
	}
}

@@ -280,756 +280,7 @@
 ;%0A%09%7D
-%0A%0A%09public byte toByte(Character n) %7B%0A%09%09switch (n) %7B%0A%09%09case 'A':%0A%09%09%09return 1;%0A%09%09case 'B':%0A%09%09%09return 2;%0A%09%09case 'C':%0A%09%09%09return 3;%0A%09%09case 'D':%0A%09%09%09return 4;%0A%09%09case 'E':%0A%09%09%09return 5;%0A%09%09case 'F':%0A%09%09%09return 6;%0A%09%09case 'G':%0A%09%09%09return 7;%0A%09%09case 'H':%0A%09%09%09return 8;%0A%09%09case 'I':%0A%09%09%09return 9;%0A%09%09case 'J':%0A%09%09%09return 10;%0A%09%09case 'K':%0A%09%09%09return 11;%0A%09%09case 'L':%0A%09%09%09return 12;%0A%09%09case 'M':%0A%09%09%09return 13;%0A%09%09case 'N':%0A%09%09%09return 14;%0A%09%09case 'O':%0A%09%09%09return 15;%0A%09%09case 'P':%0A%09%09%09return 16;%0A%09%09case 'Q':%0A%09%09%09return 17;%0A%09%09case 'R':%0A%09%09%09return 18;%0A%09%09case 'S':%0A%09%09%09return 19;%0A%09%09case 'T':%0A%09%09%09return 20;%0A%09%09case 'U':%0A%09%09%09return 21;%0A%09%09case 'V':%0A%09%09%09return 22;%0A%09%09case 'W':%0A%09%09%09return 23;%0A%09%09case 'X':%0A%09%09%09return 24;%0A%09%09case 'Y':%0A%09%09%09return 25;%0A%09%09case 'Z':%0A%09%09%09return 26;%0A%09%09default:%0A%09%09%09return 0;%0A%09%09%7D%0A%09%7D
 %0A%7D%0A

modify ExcelSheetColumnNumber