Combine two strings solution using a stack.