LeetCode – 14. Longest Common Prefix

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"

132
0 0 132

Further Reading

Post a reply

Log inYou can only comment after that.
Share this page
Back to top