Implement another solution for string concatenation problem by using a HashMap and a Queue.