cgorrillaha

Untitled

Nov 30th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. int countSame=0;
  2. // int maxRun=0;
  3. // String runChar="";
  4. // for(int i=0; i<s.length();i++){
  5. // String current=s.substring(i,i+1);
  6. // String next="";
  7. // if(i<s.length()-1) {
  8. // next= s.substring(i + 1, i + 2);
  9. // }
  10. //
  11. // if(current.equals(next)){
  12. // runChar=current;
  13. // System.out.printf("1: current: %s, next: %s, runchar: %s%n", current, next, runChar);
  14. // countSame++;
  15. // }
  16. // else if(current.equals(runChar)){
  17. // countSame++;
  18. // if(countSame>maxRun){
  19. // maxRun=countSame;
  20. // }
  21. // countSame=0;
  22. // System.out.printf("2: current: %s, next: %s, runchar: %s%n", current, next, runChar);
  23. // }
  24. // else{
  25. // countSame=0;
  26. // }
  27. //
  28. //
  29. //
  30. // }
  31. // System.out.println(maxRun);
Advertisement
Add Comment
Please, Sign In to add comment