sanhayu546's blog

By sanhayu546, history, 17 months ago, In English

Like we have an array containing 0 and 1 only of length (10^5). we have to do some sort of operation on 1 only like the right shift or left shift by one unit of length so that All 1 in same fashion. And one operation of cost is 1 unit, in minimum cost all 1 in the same fashion.

Example:- 0010101 -> Like in 2 operations we have an array look like this 0001110.

can somebody tell me how to solve this problem?

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it