摘要: day2-1 No.14 最长公共前缀 暴力求解即可,我采用的是纵向比较法,时间复杂度:O(mn)。 class Solution { public: string longestCommonPrefix(vector<string>& strs) { int len=strs.size(); if 阅读全文
posted @ 2021-01-04 20:55 UYNAIT 阅读(50) 评论(0) 推荐(0)
摘要: day1 字符串转换整数(有限状态机) 1、有限状态机的概念,怎么写?编译原理学过 class Solution { public: int myAtoi(string str) { long res = 0; int state = 0 ; // state == 0 为初始状态 ,1 为正整数状 阅读全文
posted @ 2021-01-03 22:30 UYNAIT 阅读(98) 评论(0) 推荐(0)