Two Pointer Algorithm Python Example