Two Pointer Algorithm Javascript Substring Email Account