Two Pointer Algorithm Javascript Array Find