For arr = [“Daisy”, “Rose”, “Hyacinth”, “Poppy”], the output should be solution(arr) = DRHPaoyoisapsecpyiynth
First, we append all 0th characters and obtain string DRHP;
Then we append all 1st characters and obtain string DRHPaoyo
Then we append all 2nd characters and obtain string DRHPaoyoisap
Then we append all 3rd characters and obtain string DRHPaoyoisapaecp
Then we append all 4th characters and obtain string DRHPaoyoisapaecpyiy
Finally, only letters in the arr[2] are left, so we append the rest characters and get “DRHPaoyoisapaecpyiynth”;