Split String Into Array Typescript Interview