Steward
分享是一種喜悅、更是一種幸福
程式語言 - LeetCode - C++ - 1784. Check if Binary String Has at Most One Segment of Ones
參考資訊:
https://algo.monster/liteproblems/1784
題目:

解答:
class Solution {
public:
bool checkOnesSegment(string s) {
return s.find("01") == string::npos;
}
};