public String longestCommonPrefix(String[] strs) {

		if (strs.length == 0)
			return "";

		String prefix = strs[0];
		for (String str : strs) {
			if (str.length() < prefix.length()) {
				prefix = str;
			}
		}

		for (String str : strs) {
			int i;
			for (i = 0; i < prefix.length(); i++) {
				if (prefix.charAt(i) != str.charAt(i)) {
					prefix = prefix.substring(0, i);
				}
			}
		}

		return prefix;
	}