O (n*n) the solution has a loop through n nested inside a loop through n Codility does update the python version occasionally, and I always mirror the current version. So puzzles solved in 2018 used ...