-
-
Save jyhjuzi/1f526165a8a54148bde4 to your computer and use it in GitHub Desktop.
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
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