aasourav's blog

By aasourav, history, 4 weeks ago, In English

Hello i am confused about This Problem's output. if we input as a string 111000 output says minimum number of operation is 2 . but here i can see if we swap between index 2 and index 5 . the string will be 101010 . and minimum number of operation will be 1 . ,, did i mistake something?? please help me to understand the author's logic.

 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

You are told to reverse substring and not swap indexes. Read the problem properly.

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    got it. thank you so much. should i delete the post??

    • »
      »
      »
      4 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes, if your doubt is cleared.