Last active
January 3, 2016 05:09
-
-
Save Se7soz/8414129 to your computer and use it in GitHub Desktop.
Read the How to prepare for an interview series at my blog: http://se7so.blogspot.com/2014/01/how-to-prepare-for-interview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool hasUniqueChs(string s) { | |
bool chs[256]; | |
memset(chs, false, sizeof chs); | |
for(int i = 0; i < s.size(); i++) { | |
if(chs[s[i]]) | |
return false; | |
chs[s[i]] = true; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment