Why my code is giving absurd output ?printing all subsequences of a string
Subsets using bit manipulation
Hey @coderajay03 , the logic of your code is correct just the variables used are wrong .
In the inner loop you used i which is being used in both the loops , so the changes being done in the while loop is also reflected on the outerloop so we have to use different independent variables in order for the code to woek .
Dry run the code once or twice to get a hang of what’s actually happening
Here’s the updated code
Hope it helps Happy coding !!
1 Like