cpp implementation of Interleaving String