摘要: 题目 分析 直接暴力搜索 代码 1 class Solution { 2 public: 3 string longestCommonPrefix(vector<string>& strs) { 4 string res ; 5 // i 控制列,j 控制l行 6 for(int i = 0;i < 阅读全文
posted @ 2022-03-15 17:07 Uitachi 阅读(25) 评论(0) 推荐(0)
摘要: 题目 分析 受LeetCode 12题目影响,一时没反应过来用哈希存储,虽说难度是简单,还没上一道做的舒服。。。。 这道题目关键在于特判下4的特殊情况,就是后一个字母比当前字母要大时情况要特殊判断下 代码 1 class Solution { 2 public: 3 int romanToInt(s 阅读全文
posted @ 2022-03-15 16:03 Uitachi 阅读(28) 评论(0) 推荐(0)