• + 1 comment

    i think your solutions is O(n^2) for the worst case.