public static String reverseWords(String s) {
		/*
		 * Assume that the parameter String can only contain spaces and
		 * alphanumeric characters. Please implement this method to reverse each
		 * word in the original String while maintaining the word order. For
		 * example: parameter: "Hello world", result: "olleH dlrow"
		 */
		if (s == null || s.isEmpty()) {
			return "";
		}
		StringBuilder sb = new StringBuilder();
		int length = s.length();
		int b = 0;
		for (int i = 0; i < length; i++) {
			char c = s.charAt(i);
			if (!Character.isLetter(c)) {
				for (int j = i - 1; j >= b; j--) {
					sb.append(s.charAt(j));
				}
				b = i;
				sb.append(c);
			}
		}
		
		// handle the last piece.
		for (int j = length-1; j >= b; j--) {
			sb.append(s.charAt(j));
		}

		return sb.toString();
	}