Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.
求最长公共前缀。
代码例如以下:
class Solution {public: string longestCommonPrefix(vector& strs) { int length = strs.size(); if (length <= 0) return ""; string prefix = strs[0]; int i, j; for (i=1; i