package leetcode;

/**
 * https://leetcode.com/problems/swap-adjacent-in-lr-string/
 */
public class Problem777 {
    public boolean canTransform(String start, String end) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem777 prob = new Problem777();
        System.out.println(prob.canTransform("RXXLRXRXL", "XRLXXRRLX")); // true
    }
}

@@ -179,36 +179,767 @@
     
-// TODO%0A        return false
+char%5B%5D s = start.toCharArray();%0A        char%5B%5D e = end.toCharArray();%0A        for (int i = 0; i %3C s.length; i++) %7B%0A            if (s%5Bi%5D != e%5Bi%5D) %7B%0A                if (i + 1 == s.length) %7B%0A                    return false;%0A                %7D%0A                if ((s%5Bi%5D == 'X' && s%5Bi + 1%5D == 'L') %7C%7C%0A                    (s%5Bi%5D == 'R' && s%5Bi + 1%5D == 'X')) %7B%0A                    swap(e, i, i + 1);%0A                    if (s%5Bi%5D != e%5Bi%5D) %7B%0A                        return false;%0A                    %7D%0A                %7D else %7B%0A                    return false;%0A                %7D%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A%0A    private static void swap(char%5B%5D chars, int i, int j) %7B%0A        char tmp = chars%5Bi%5D;%0A        chars%5Bi%5D = chars%5Bj%5D;%0A        chars%5Bj%5D = tmp
 ;%0A  
@@ -1028,24 +1028,26 @@
 oblem777();%0A
+//
         Syst
@@ -1115,16 +1115,253 @@
 // true%0A
+//        System.out.println(prob.canTransform(%22RXXLRXRXL%22, %22XRLXXRRLL%22)); // false%0A//        System.out.println(prob.canTransform(%22LR%22, %22RL%22)); // false%0A        System.out.println(prob.canTransform(%22XXXXXLXXXX%22, %22LXXXXXXXXX%22)); // true%0A
     %7D%0A%7D%0A

Update problem 777