Блог пользователя ankushmondal1y2t

Автор ankushmondal1y2t, история, 4 часа назад, По-английски

You are given a binary string and you have to find out minimum bits to flip(either from 0 --> 1 or 1 --> 0) to become number of 1's divisible by 4 and palindrome string

example s = 1110 if i flip the last bit 0 to 1 then the string becomes 1111 which is palindrome and the number of 1's divisible by 4

in one operation u can do flip 1 to 0 then 0 to 1 you have to just find out the minimum bits to flip to satisfy the following condition

can anyone tell me its solution or intuition??

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by ankushmondal1y2t (previous revision, new revision, compare).

»
3 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

u need to minimize the number of operations ??

»
2 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by ankushmondal1y2t (previous revision, new revision, compare).