Tap here to switch tabs
Problem
Submissions

Problem: Check if Binary String Has at Most One Segment of Ones

med
30 min
Try to solve the Check if Binary String Has at Most One Segment of Ones problem.

Statement

Given a binary string s, determine whether s contains at most 11 contiguous segment of ′1′'1's. Return True if it contains at most 11 contiguous segment of ′1′'1's, and False otherwise.

Constraints:

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

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

  • s[00] is ′1′'1'

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check if Binary String Has at Most One Segment of Ones

med
30 min
Try to solve the Check if Binary String Has at Most One Segment of Ones problem.

Statement

Given a binary string s, determine whether s contains at most 11 contiguous segment of ′1′'1's. Return True if it contains at most 11 contiguous segment of ′1′'1's, and False otherwise.

Constraints:

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

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

  • s[00] is ′1′'1'