You want to implement it:
1) using specific knowledge about content:
count number of 0's and 1' adt then overwrite your string with required number of 0's and then 1's
Let’s say there is a string of 0 and 1, e.g.g. 00010111010.
The goal is to sort it. 2 pairs can be switched on each step. For example the mentioned above string can be sorted in following steps:
0. 00010111010
1. 00001111100
2. 00000011111
I can solve this, but when it is
101010
in this case I can not swap 2bites in each step