给出三个字符串s1, s2, s3,判断s3是否可以由s1和s2交织而成。 例如: 给定 s1 ="xxyzz", s2 ="pyyzx", 如果s3 ="xxpyyzyzxz", 返回true 如果s3 ="xxpyyyxzzz", 返回false
示例1
输入
"xxyzz","pyyzx","xxpyyzyzxz"
输出
true
示例2
输入
"xxyzz","pyyzx","xxpyyyxzzz"
输出
false
加载中...
import java.util.*; public class Solution { /** * * @param s1 string字符串 * @param s2 string字符串 * @param s3 string字符串 * @return bool布尔型 */ public boolean isInterleave (String s1, String s2, String s3) { // write code here } }
class Solution { public: /** * * @param s1 string字符串 * @param s2 string字符串 * @param s3 string字符串 * @return bool布尔型 */ bool isInterleave(string s1, string s2, string s3) { // write code here } };
# # # @param s1 string字符串 # @param s2 string字符串 # @param s3 string字符串 # @return bool布尔型 # class Solution: def isInterleave(self , s1 , s2 , s3 ): # write code here
/** * * @param s1 string字符串 * @param s2 string字符串 * @param s3 string字符串 * @return bool布尔型 */ function isInterleave( s1 , s2 , s3 ) { // write code here } module.exports = { isInterleave : isInterleave };
# # # @param s1 string字符串 # @param s2 string字符串 # @param s3 string字符串 # @return bool布尔型 # class Solution: def isInterleave(self , s1 , s2 , s3 ): # write code here
package main /** * * @param s1 string字符串 * @param s2 string字符串 * @param s3 string字符串 * @return bool布尔型 */ func isInterleave( s1 string , s2 string , s3 string ) bool { // write code here }
"xxyzz","pyyzx","xxpyyzyzxz"
true
"xxyzz","pyyzx","xxpyyyxzzz"
false