<gouthampradhan>string_LongestCommonPrefix_1.java
public String longestCommonPrefix(String[] strs) {
    if (strs.length == 0) return "";
    String result = strs[0];
    for (int i = 1; i < strs.length; i++) {
      String s = strs[i];
      for (int j = 0; j < result.length(); j++) {
        if (j >= s.length() || result.charAt(j) != s.charAt(j)) {
          result = result.substring(0, j);
          break;
        }
      }
    }
    return result;
  }
public String var_0 ( String [ ] var_2 ) {
  if ( var_2 . length == 0 ) return "" ;
  String var_6 = var_2 [ 0 ] ;
  for ( int var_8 = 1 ;
  var_8 < var_2 . length ;
  var_8 ++ ) {
    String var_9 = var_2 [ var_8 ] ;
    for ( int var_10 = 0 ;
    var_10 < var_6 . length ( ) ;
    var_10 ++ ) {
      if ( var_10 >= var_9 . length ( ) || var_6 . charAt ( var_10 ) != var_9 . charAt ( var_10 ) ) {
        var_6 = var_6 . substring ( 0 , var_10 ) ;
        break ;
      }
    }
  }
  return var_6 ;
}
