fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. System.out.println(move("HELlo World"));
  9. }
  10.  
  11. public static String move(String str){
  12. StringBuilder sb = new StringBuilder(str);
  13. int d=0;
  14. for(int i=0; i<str.length(); i++) {
  15. int ch = str.charAt(i);
  16. if(ch >= 65 && ch <= 90) {
  17. sb.deleteCharAt(i-d++).append((char)ch);
  18. }
  19. }
  20. return sb.toString();
  21. }
  22.  
  23. }
Success #stdin #stdout 0.06s 381248KB
stdin
Standard input is empty
stdout
lo orldHELW