Can be easily solved using Longest Common Subsequence concept


it should just fulfill the following condition

string A, B, C; // A + B -> C
sizeA = A.size();
sizeB = B.size();

if (sizeA == LCS(A, C) && sizeB == LCS(B, C)) return 1;
else return 0;


What about this test case
according to your solution answer is true while correct answer is false but interview bit is accepting your solution


Did the same approach. Not accepted


How about
Step 1 : sizeA == LCS(A,C)
Step 2 : remove the A subsequence from C
Step 3 : sizeB == LCS(B,C)

This should work, right ?


I guess test cases of IB are weak. That’s why it got accepted with this approach. I got WA with this on leetcode.