Updated CountNonZerosInUpperTriangle.