P17953 [GeeksforGeeks] String conversion4603
普及
题目描述

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.
Make some lowercase letters uppercase.
Delete all the lowercase letters.
NOTE: You can perform one,two or none operations to convert the string X to Y as needed.
Example 1:
Input: X = "daBcd", Y = "ABC"
Output: 1
Explanation: Convert 'a' and 'c', delete
both the d's
Example 2:
Input: X = "ABcd", Y = "BCD"
Output: 0
Explanation: Can not delete A
Your Task:
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|)
Constraints:
1 ≤ |X|, |Y| ≤ 10^{3}

输入格式

见题面

输出格式

见题面

样例输入
X = "daBcd", Y = "ABC"
样例输出
1