Beautiful Binary String

Sort by

recency

|

6 Discussions

|

  • + 0 comments

    One liner in JAVA :

    System.out.println((n-B.replaceAll("010","").length())/3);

  • + 0 comments

    Why is Test Case #6 solution = 11 and not 10?...

  • + 1 comment

    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 ?

  • + 0 comments

    Can someone explain how they did this one? I was able to pass all but one test case. My method was:

    1010 -> 1000
    0101 -> 0111
    0100 -> 1100
    0010 -> 0011
    

    And I passed over the array once forward and once in reverse and took the minimum number of swaps of the traversals.

  • + 1 comment

    how to get solution of these challenge, once the challenge is over?