Given two strings X and Y, the task is to check if it is possible to convert X to Y by performing the following operations.
Input: X = "daBcd", Y = "ABC" Output: 1 Explanation: Convert 'a' and 'c', delete both the d's
Input: X = "ABcd", Y = "BCD" Output: 0 Explanation: Can not delete A
You don't need to read input or print anything. Your task is to complete the function stringConversion() which takes the strings as input and returns 1 if it is possible to convert, otherwise 0.
Expected Time Complexity: O(|X|*|Y|)
Expected Auxiliary Space: O(|X|*|Y|)
1 ≤ |X|, |Y| ≤ 103
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.