WiseMatrix algorithm the complexity of the algorithm is in the first
comment