Skip to content

Instantly share code, notes, and snippets.

@XinboChen
Created August 26, 2014 16:19
Show Gist options
  • Save XinboChen/ab76aff9611a28e2a56e to your computer and use it in GitHub Desktop.
Save XinboChen/ab76aff9611a28e2a56e to your computer and use it in GitHub Desktop.
class unique{
public boolean check(String s){
if(s.length == 0)
return true;
String sorted = Sort(s);
for(int i = 0; i < sorted.length - 1 ; i ++){
if ( sorted.charAt( i ) == sorted.charAt( i + 1 ))
return false;
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment