Practice Longer Contiguous Segments of Ones than Zeros
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
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. 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.
Source: Longer Contiguous Segments of Ones than Zeros on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "1101"
true
# Example 2
s = "111000"
false
# Example 3
s = "110100010"
false
Constraints
Related LeetCode Problems
Practice more problems similar to Longer Contiguous Segments of Ones than Zeros.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.