DDSA
Advertisement

1784. Check if Binary String Has at Most One Segment of Ones

1784.cs
C#
public class Solution
{
    public bool CheckOnesSegment(string s)
    {
        return !s.Contains("01");
    }
}
Advertisement