fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static boolean main (String s) throws java.lang.Exception
  11. {
  12. if(s.length() > 256){
  13. return false;
  14. }
  15.  
  16. HashMap<Character,Boolean> seen = new HashMap<Character,Boolean>();
  17. char[] chars = s.toCharArray();
  18. for(int i=0; i < chars.length; i++){
  19. if(seen.containsKey(chars[i]){
  20. return false;
  21. }
  22. else{
  23. seen.put(chars[i],true);
  24. }
  25. }
  26. return true;
  27. }
  28.  
  29.  
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:19: error: ')' expected
				if(seen.containsKey(chars[i]){
				                             ^
Main.java:31: error: class, interface, or enum expected
}
^
2 errors
stdout
Standard output is empty