Minimal length of a string that contains two strings
Following the explanation on Wikipedia,


obtain the longest common subsequence of $a$ and $b$ with a (quite elementary) dynamic programming approach and
insert the characters which are not part of the LCS in-order and in appropriate positions.


Note that the result of neither step is necessarily unique.

Writing actual (pseudo)code, correctness proof and runtime analysis are easy exercises.