Skip to content

Instantly share code, notes, and snippets.

@Se7soz
Last active January 3, 2016 05:09
Show Gist options
  • Save Se7soz/8414129 to your computer and use it in GitHub Desktop.
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
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