Apple interview question

Use Join to solve question