Write a function to find the longest common prefix string amongst an array of strings.
It's not difficult, I won't go into details.
public String longestCommonPrefix(String[] strs) { if(strs.length < 1) return ''; String pre = strs[0]; int i =0; while(i This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:
Original author:Jake Tao,source:"LeetCode – 14. Longest Common Prefix"