<awangdev>14. Longest Common Prefix_2.java
public String longestCommonPrefix(String[] strs) {
        if (strs == null || strs.length == 0) {
            return "";
        }
        if (strs.length == 1) {
            return strs[0];
        }
        String prefix = "";
        int ind = 0;
        while (ind < strs[0].length()) {
            char c = strs[0].charAt(ind);
            boolean valid = false;
            for (int i = 1; i < strs.length; i++) {
                if (strs[i].length() > ind && strs[i].charAt(ind) == c) {
                    valid = true;
                } else {
                    valid = false;
                    break;
                }
            }
            if (valid) {
                prefix += "" + c;
            } else {
                break;
            }
            ind++;
        }
        return prefix;
    }
public String var_0 ( String [ ] var_2 ) {
  if ( var_2 == null || var_2 . length == 0 ) {
    return "" ;
  }
  if ( var_2 . length == 1 ) {
    return var_2 [ 0 ] ;
  }
  String var_8 = "" ;
  int var_9 = 0 ;
  while ( var_9 < var_2 [ 0 ] . length ( ) ) {
    char var_11 = var_2 [ 0 ] . charAt ( var_9 ) ;
    boolean var_14 = false ;
    for ( int var_13 = 1 ;
    var_13 < var_2 . length ;
    var_13 ++ ) {
      if ( var_2 [ var_13 ] . length ( ) > var_9 && var_2 [ var_13 ] . charAt ( var_9 ) == var_11 ) {
        var_14 = true ;
      }
      else {
        var_14 = false ;
        break ;
      }
    }
    if ( var_14 ) {
      var_8 += "" + var_11 ;
    }
    else {
      break ;
    }
    var_9 ++ ;
  }
  return var_8 ;
}
