fork(2) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4.  
  5. class Main{
  6. public static void main(String[] a){
  7. // Test code:
  8. a = new String[]{ "ThIs Is ThE iNPUT , WITH 72/2 CHARS!" };
  9.  
  10. Map<Long, Long> m = new LinkedHashMap();
  11. for(long c : a[0].toCharArray()){
  12. m.put(c, m.get(c) != null ? m.get(c) + 1 : 1);
  13. }
  14. for(Long e : m.values()){
  15. System.out.print(e + " ");
  16. }
  17. }
  18. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
4 2 3 2 7 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1