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 void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. String str = new String();
  14. int a;
  15.  
  16. Scanner scr = new Scanner(System.in);
  17. a = scr.nextInt();
  18. System.out.println("here1 ");
  19. for(int i = 0; i < a; i++)
  20. {
  21. int arr[] = new int[26];
  22. str = scr.next();
  23. System.out.println("here 1.3 ");
  24. for(int j = 0; j < str.length(); j++)
  25. {
  26. //System.out.println("here 1.4 " + str.charAt(j) + " " + Integer.parseInt(Character.toString(str.charAt(j))) );
  27. arr[Character.getNumericValue(str.charAt(j))]++;
  28. System.out.println("here 1.5 ");
  29. }
  30. System.out.println("here2 ");
  31. int b[] = new int[5];
  32. b[0]= arr[5];
  33. b[1] = arr[0];
  34. b[2] = arr[1];
  35. b[3] = arr[14]/2;
  36. b[4] = arr[17];
  37.  
  38. int small = 100000;;
  39. for(int k = 0; i < 5; i++)
  40. {
  41. if(small > b[k])
  42. {
  43. small = b[k];
  44. }
  45. }
  46. System.out.println(small);
  47. }
  48. }
  49. }
Runtime error #stdin #stdout #stderr 0.1s 380608KB
stdin
3
foobar
foobarfoobar
fffffff
stdout
here1 
here 1.3 
here 1.5 
here 1.5 
here 1.5 
here 1.5 
here 1.5 
stderr
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 27
	at Ideone.main(Main.java:27)