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

浙公网安备 33010602011771号