We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
MohitKumar6122
In the question #387 statement it is written as
return the first non-repeating character in it and return its index.
instead this should be written as
find the first non-repeating character in it and return its index.
class Solution { public: int firstUniqChar(string s) { vector<pair<int, int>> freq(26, pair<int, int > (0, 0)) ; for(int i = 0 ; i < s.size(); ++i){ freq[s[i] - 'a'].first++ ; freq[s[i] - 'a'].second = i ; } int ans = INT_MAX ; for(int i = 0; i < 26; ++i){ if (freq[i].first == 1) ans = min(ans , freq[i].second) ; } return ans == INT_MAX ? -1 : ans ; } };
C++
The text was updated successfully, but these errors were encountered:
Hi @Mohitkumar6122 Thank you for reaching out to us. I've relayed this issue to our team to investigate.
Sorry, something went wrong.
Welcome @lc-kay for addressing this issue. I think we can close this issue now.
lc-kay
No branches or pull requests
Your LeetCode username
MohitKumar6122
Category of the bug
Description of the bug
In the question #387 statement it is written as
instead this should be written as
Code you used for Submit/Run operation
Language used for code
C++
Expected behavior
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: