LeetCode 面试题 16.18. 模式匹配

原题目:https://leetcode-cn.com/problems/pattern-matching-lcci/rest   思路:code 假设p的长度为lp.v的长度为lv,在p中,有ca个a,那么对应的就有(lp - ca)个b,又假设a对应的字符串的长度为la,b对应的字符的长度为lb。对此咱们能够获得:ci ca*la + (lp-ca)*lb = lvleetcode 咱们能够对
相关文章
相关标签/搜索