• + 0 comments

    Great solution. Isn't the space complexity O(n)? Since you create an array of n elements how is the space complexity O(1)?