Pergunta de entrevista da empresa IBM

compare the given strings and join them in alphabetic order.