<p>Given a binary string <code>s</code> <strong>​​​​​without leading zeros</strong>, return <code>true</code>​​​ <em>if </em><code>s</code><em> contains <strong>at most one contiguous segment of ones</strong></em>. Otherwise, return <code>false</code>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;1001&quot;
<strong>Output:</strong> false
<strong>Explanation: </strong>The ones do not form a contiguous segment.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;110&quot;
<strong>Output:</strong> true</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= s.length &lt;= 100</code></li>
	<li><code>s[i]</code>​​​​ is either <code>&#39;0&#39;</code> or <code>&#39;1&#39;</code>.</li>
	<li><code>s[0]</code> is&nbsp;<code>&#39;1&#39;</code>.</li>
</ul>

class Solution:
    def checkOnesSegment(self, s: str) -> bool:
        # If the string consists of only one character, it satisfies the condition.
        if len(s) == 1:
            return True
        
        # Find the first occurrence of '0'
        first_zero_index = s.find('0')
        
        # If there are no '0's in the string, it satisfies the condition.
        if first_zero_index == -1:
            return True
        
        # Check if there are any '1's after the first '0'
        for char in s[first_zero_index:]:
            if char == '1':
                return False
        
        return True

# Example usage:
solution = Solution()
print(solution.checkOnesSegment("1001"))  # Output: False
print(solution.checkOnesSegment("110"))   # Output: True
26