Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1 #36

Open
renx125 opened this issue Mar 2, 2020 · 1 comment
Open

1 #36

renx125 opened this issue Mar 2, 2020 · 1 comment

Comments

@renx125
Copy link

renx125 commented Mar 2, 2020

int removeDuplicates(vector& nums) {
int i = !nums.empty();
for (int n : nums)
if (n > nums[i-1])
nums[i++] = n;
return i;
}

@renx125
Copy link
Author

renx125 commented Mar 2, 2020

  1. for (int n : nums) 和 find
    for (int n : nums) 就其实是

for(int i; i<nums.size(); i++)
{
n = nums[i]
...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant