• + 1 comment

    I guess editorial solution is not the best. It takes O(n) space which is not necessary