python - Implementing the Alon-Matias-Szegedy Algorithm For The Second Moment Stream Approximation - Stack Overflow