Test case for STRMRG Jan 18 Long

link to question : STRMRG Problem - CodeChef

Link to my sol : 5Eu0Mv - Online C++ Compiler & Debugging Tool - Ideone.com

Need test case where my code fails?

Approach:

For each element of str2,finding first element in str1 which is equal to element of str2
and inserting it there(say at position ā€˜pā€™) then for next element of str2 finding first element in str1 starting from p.
Similary doing it for str1.

Then finding min from two cases.

Here you go

1

20 20

bacbadbcabdbbdadccaa

ccdbccbdddbcbaaaccdb

Correct Answer: 21
Your Answer: 22