SHARE
TWEET

Untitled

a guest Nov 12th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void main(String[] args) {
  2.         String incoming = "AABBBBCCDDDDDMMVG";
  3.         char[] chars = new char[incoming.length()];
  4.         chars[0] = incoming.charAt(0);
  5.  
  6.         int border = 1;
  7.         for (int i = 1; i < incoming.length(); i++) {
  8.             if (incoming.charAt(i) != incoming.charAt(i - 1)) {
  9.                 if (i - border > 1) {
  10.                 } else {
  11.  
  12.                 }
  13.             } else {
  14.                 border++;
  15.             }
  16.         }
  17.  
  18.         System.out.println(new String(chars, 0, border));
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top