Content:
Given a binary string s
, return true
if the longest contiguous segment of 1
's is strictly longer than the longest contiguous segment of 0
's in s
, or return false
otherwise.
- For example, in
s = "110100010"
the longest continuous segment of1
s has length2
, and the longest continuous segment of0
s has length3
.
Note that if there are no 0
's, then the longest continuous segment of 0
's is considered to have a length 0
. The same applies if there is no 1
's.文章来源:https://www.toymoban.com/news/detail-614181.html
Example 1:文章来源地址https://www.toymoban.com/news/detail-614181.html
Input: s = "1101" Output: true Explanation: The l
到了这里,关于LeetCode --- 1869. Longer Contiguous Segments of Ones than Zeros 解题报告的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!