• + 1 comment

    But still the complexity of the code remains same as o(n).

    Is there any solution with o(1).