JAVA O(n) Two Pointer Solution
Use two pointer to check the following 2 conditions:\n1. Without 'X', 'L' and 'R' has the same relative position in start and end\n2. For any corresponding 'R' 
Use two pointer to check the following 2 conditions:\n1. Without 'X', 'L' and 'R' has the same relative position in start and end\n2. For any corresponding 'R' in start and end, say start[i] and end[j], i <= j, and for any corresponding 'L', i >= j.\n```\npublic boolean canTransform(String start, String end) {\n    if (start.length() != end.length()) {\n        return false;\n    }\n    int i = 0, j = 0;\n    while (i < start.length() && j < end.length()) {\n        if (start.charAt(i) == 'X') {\n            i++;\n            continue;\n        }\n        else if (end.charAt(j) == 'X') {\n            j++;\n            continue;\n        }\n        else if (start.charAt(i) == end.charAt(j)) {\n            if ((start.charAt(i) == 'R' && i > j) || (end.charAt(j) == 'L' && i < j)) {\n                return false;\n            }\n            i++;\n            j++;\n        }\n        else {\n            return false;\n        }\n    }\n    while (i < start.length()) {\n        if (start.charAt(i++) != 'X') {\n            return false;\n        }\n    }\n    while (j < end.length()) {\n        if (end.charAt(j++) != 'X') {\n            return false;\n        }\n    }\n    return true;\n}\n```
[]