public String longestCommonPrefix(String[] strs) {
            if (strs.length == 0)
                return "";

            String result = strs[0];
            for (int i = 0; i < strs.length; i++) {
                result = getCommonPrefix(result, strs[i]);
            }

            return result;
        }