Say you are given a an array of sentences. The desired output is an array of sentences that are concatenated by end of one sentence to the beginning of the other.
Input:
["i love dogs", "the grass is green", "dogs are fun", "green paint is wacky", "wacky is cool", "fun times ahead", "dogs and cats"]
Output (Order does not matter):
["i love dogs are fun", "i love dogs and cats", "the grass is green paint is wacky", "dogs are fun times ahead", "green paint is wacky is cool"]