Member • Nov 1, 2008
programming problem in C++
I have a string of 0's and ones which is to be inputted by the user ..
may be something like "000110010"..The solution is a string in which I get 0's on one side and 1's on other side( like compaction where 0 represents used memory and 1 represents free memory)..+ the total distance (in terms of shifts) ..
For the string: 000110010..the output would be 000000111. and the diatance 1's or 0's have to be moved to achieve the output!
Can anyone help ????