Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -39,7 +39,7 @@ class Solution {

std::vector<int> computeRightArray(const std::string& s)
{
int n = s.mgth();
int n = s.size();
std::vector<int> right(n, 0);

for (int i = n-2; i >=0; i--) {
Expand All @@ -50,4 +50,4 @@ class Solution {

return right;
}
};
};