Check if Binary String Has at Most One Segment of Ones

EasyString

Solution

export function checkOnesSegment(s: string): boolean {
  return !s.includes('01');
}