I have two lists having all distinct elements. One contains $m$ elements and other contains $n$ elements. We need to arrange them such that the order of elements of individual lists is not disturbed.
Example -
for list1=[1,2], list2=[3,4]
m=2,n=2
Total ways to arrange them will be -
1-2-3-4
1-3-2-4
1-3-4-2
3-4-1-2
3-1-2-4
3-1-4-2
I am unable to come up with a general solution.
PS: This is not a homework/assignment.
Hint: You know how many total slots there are in the final list. Just pick some set of those slots to receive the items of the first list and everything is determined.