Difference between no extra space, constant space

Are they same ?

And how to distinguish b/w them ?

When we declare variables then is it constant space ? Because all problems will require some variables to be declared, so how to achieve no extra space ?

No they are not same.
When we declare any variable it takes constant space.
But when you take a data structure such as array or hashmaps…these take extra space of O(n)

No extra space can be achieved by without using any extra array, hashmap or so…to solve the problem.

Okay… got the 1st reply. For 2nd reply-> In the “code video” of Unique Number - II, we have used an array, even though the ques was “No extra space”. Is it because of fixed size ?

Input array is not considered here …when you see extra space…
If your algo requires an extra array other than the input, that will contribute to extra space.

OK
If suppose, i/p is list of numbers. I store it in ‘a’. Also, I created an array ‘b’ containning reverse of list of numbers. So is this ‘b’ an extra space ?

Yes it will be considered as extra space.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.