当前位置:首页 » 《随便一记》 » 正文

LeetCode --- 1446. Consecutive Characters 解题报告

8 人参与  2022年11月13日 19:05  分类 : 《随便一记》  评论

点击全文阅读


The power of the string is the maximum length of a non-empty substring that contains only one unique character.

Given a string s, return the power of s.

Example 1:

Input: s = "leetcode"Output: 2Explanation: The substring "ee" is of length 2 with the character 'e' only.

Example 2:

Input: s = "abbcccddddeeeeedcba"Output: 5Explanation: The substring "eeeee" is of length 5 with the character 'e' only.

Constraints:

1 <= s.length <= 500 s consists of only lowercase English letters.

所有代码均可在Github中找到:


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/48252.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1