If the flag is true and both pointers points to their end of respective Strings then it is possible to transformed str1 into str2 , otherwise not .
if ( flag && ptr1 == str1 . Length && ptr2 == str2 . Length ) { Console . Write ( " YES " + " STRNEWLINE " ) ; } else { Console . Write ( " NO " + " STRNEWLINE " ) ; } }