• + 1 comment

    I have implemented it in O(n).