We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Beautiful Binary String
Beautiful Binary String
Sort by
recency
|
6 Discussions
|
Please Login in order to post a comment
One liner in JAVA :
System.out.println((n-B.replaceAll("010","").length())/3);
Why is Test Case #6 solution = 11 and not 10?...
The output to input: 100 0100101010100010110100100110110100011100111110101001011001110111110000101011011111011001111100011101 should be 11 not 10. by changing index (zero indexed): 1, 5, 7, 9, 14, 19, 22, 31, 47, 51 and 70. How can it be done in 10 changes ?
Can someone explain how they did this one? I was able to pass all but one test case. My method was:
And I passed over the array once forward and once in reverse and took the minimum number of swaps of the traversals.
how to get solution of these challenge, once the challenge is over?