diff --git a/Two_Pointers/3234.Count-the-Number-of-Substrings-With-Dominant-Ones/3234.Count-the-Number-of-Substrings-With-Dominant-Ones.cpp b/Two_Pointers/3234.Count-the-Number-of-Substrings-With-Dominant-Ones/3234.Count-the-Number-of-Substrings-With-Dominant-Ones.cpp index 1366613b4..545600ce9 100644 --- a/Two_Pointers/3234.Count-the-Number-of-Substrings-With-Dominant-Ones/3234.Count-the-Number-of-Substrings-With-Dominant-Ones.cpp +++ b/Two_Pointers/3234.Count-the-Number-of-Substrings-With-Dominant-Ones/3234.Count-the-Number-of-Substrings-With-Dominant-Ones.cpp @@ -21,7 +21,7 @@ class Solution { if (right[j-1] + have >= count*count) { int extra = right[j-1] - max(0, count*count-have); - ret += max(extra+1, 0); + ret += extra+1; } count -= (s[i]=='0'); @@ -39,7 +39,7 @@ class Solution { std::vector computeRightArray(const std::string& s) { - int n = s.mgth(); + int n = s.size(); std::vector right(n, 0); for (int i = n-2; i >=0; i--) { @@ -50,4 +50,4 @@ class Solution { return right; } -}; +}; \ No newline at end of file