摘要: 方法一 循环: class Solution {public: string longestCommonPrefix(vector<string>& strs) { if(strs.empty()) { return ""; } //注意为空的情况 string str1; //从vector中取 阅读全文