Faster than 100.00 % ||CPP || O(N)
\n\n## APPROACH EXPLAINATION :\n1.  First we check if the size of both strings are same or not.\n1. If size are same:\n   * Then we check for the frequency of c
\n\n## **APPROACH EXPLAINATION :**\n1.  First we check if the size of both strings are same or not.\n1. If size are same:\n   * Then we check for the frequency of character \'R\' ans \'L\' in both the string.\n   *   For string start , just add the frequency in the count_l and count_r \n       and for string target, subtracts the  frequency from  count_l and count_r \n1. If count_l and count_r are not 0, then frequency of characters are not same , return false.\n1. Now we check if the position of characters can be changed  to get the target  string or not. \n*   Store the index of \'R\' and \'L\' of start in a stack.\n*  Iterate the  string target from last and check for the foloowing\n    *  if  char is "_" , iterate for next index.\n    *  if the character of target and that in the stack is not same , then start can\'t be converted to target\n    *  if char of target is same as the top of stack\n      ! If char is "R" => Then the index on the top should be lesser then the curr iterating index, as "R" can only move to right direction, \n                          so this would never be moved  to target\'s index position\n    *  Similarly we check for  char "L" also.\n\n* If all\'s well then string start can be converted to target\n\n**Time complexity: O(N)\nSpace complexity  : O(N)**\n\n\n\n```\n bool canChange(string start, string target) {\n       int s=start.size(), t= target.size(); \n       if(s!=t) return false;\n    \n      stack<int> st;\n      int count_l=0,count_r=0;  // Storing the frequency of characters \'L\' and \'R\'\n      for(int i=0;i<s ;i++)\n      {\n           if(start[i]==\'L\')  count_l++;\n           else if(start[i]==\'R\') count_r++;\n           \n           if(target[i]==\'L\') count_l--;\n           else if(target[i]==\'R\') count_r--;\n          \n           if(start[i]!=\'_\') st.push(i);  // storing index values in stack\n           \n     }\n        \n     if( count_l ||count_r) // if count of characters are not same in start and target\n         return false;  \n  \n        \n     //Now check if the placement of characters are in correct position \n     for(int i= t-1;i>=0;i--)  \n     {\n        if(target[i]== \'_\')\n            continue;\n         \n        if(target[i]== start[st.top()])\n        {\n          if(target[i]==\'L\' && i> st.top() || target[i]==\'R\' && i<st.top()) \n            return false;\n        }\n        else if(target[i]!= start[st.top()])\n            return false;\n         \n        st.pop();\n     }\n        \n    return true;\n    }\n```\n\n  PLEASE UPVOTE IF MY EXPLAINATION WAS HELPFUL\n  ![image](https://assets.leetcode.com/users/images/00967497-47f3-4301-a9d3-1accd90df71b_1657456889.5853913.jpeg)
['String', 'Stack', 'C++']