• + 2 comments

    I believe this is O(n^2). O(n) is also possible.