Tap here to switch tabs
Problem
Submissions

Problem: Longer Contiguous Segments of Ones than Zeros

Longer Contiguous Segments of Ones than Zeros compares a binary string's longest run of ones with its longest run of zeros, returning whether the ones run is strictly longer.

Statement

Given a binary string s, return true if the longest contiguous segment of 11s is strictly longer than the longest contiguous segment of 00s in s, or return false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s[i] is either '0' or '1'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longer Contiguous Segments of Ones than Zeros

Longer Contiguous Segments of Ones than Zeros compares a binary string's longest run of ones with its longest run of zeros, returning whether the ones run is strictly longer.

Statement

Given a binary string s, return true if the longest contiguous segment of 11s is strictly longer than the longest contiguous segment of 00s in s, or return false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s[i] is either '0' or '1'.