Solve a classic string or array manipulation puzzle such as finding common elements or reversing words while explaining your complexity trade-offs.