title: Iterate over a strings array and get a new string
body: <p>Let say I have an array names = ["CAT", "DOG"], I want to iterate over this array to get a new name. To get a new name compare "C" of cat with "D" of "DOG" "C" comes before "D" so first letter will be "C".</p>
  
  <p>Then, we will compare "A" of CAT with "D" of "DOG", again "A" comes first, so second word will be "A". Word so far is : "CA".</p>
  
  <p>Then we will compare "T" of "CAT" with "D" of "DOG", this time "D" comes before "T" so third word will be "D" and so on..</p>
  
  <p>Final word will be : CADOGT</p>
  
  <p>Thanks in advance.</p>