From 809b604d504cabda90aa2cb9304308c61cb5cc8d Mon Sep 17 00:00:00 2001 From: chl131 Date: Tue, 18 Nov 2025 19:51:24 -0800 Subject: [PATCH] Fix typo: s.mgth() -> s.size() in 3234.Count-the-Number-of-Substrings-With-Dominant-Ones --- ...34.Count-the-Number-of-Substrings-With-Dominant-Ones.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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