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

Автор sanhayu546, история, 17 месяцев назад, По-английски

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?

Полный текст и комментарии »

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