Simple Java Solution
public boolean canTransform(String start, String end) {\n        int r = 0, l = 0;\n        for (int i = 0; i< start.length(); i++){\n            if (start.char
    public boolean canTransform(String start, String end) {\n        int r = 0, l = 0;\n        for (int i = 0; i< start.length(); i++){\n            if (start.charAt(i) == \'R\'){ r++; l = 0;}\n            if (end.charAt(i) == \'R\') { r--; l = 0;}\n            if (end.charAt(i) == \'L\') { l++; r = 0;}\n            if (start.charAt(i) == \'L\') { l--; r = 0;}\n            if (l < 0 || r < 0) return false;\n        }\n\n        if (l != 0 || r != 0) return false;\n        return true;\n    }\n
[]