how can i keep track of the elements which are added without using any extra space?
How can i keep track of the elements which are added without using any extra space?
hello @haseebshaik00
space will be required to store visited states without space it is not possible keep track.
one thing that u can do is instead of declaring new array u can use the given array for keeping the track of visited array