Skip to content

Instantly share code, notes, and snippets.

@jyhjuzi
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyhjuzi/1f526165a8a54148bde4 to your computer and use it in GitHub Desktop.
Save jyhjuzi/1f526165a8a54148bde4 to your computer and use it in GitHub Desktop.
public class Q1_1{
public static void main(String args[]){
String test = "";
System.out.println(checkUnique(test));
}
public static boolean checkUnique(String s){
boolean[] signs = new boolean[256];
for(int i =0; i<s.length();i++){
if(signs[s.charAt(i)])
return false;
else
signs[s.charAt(i)]=true;
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment