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

Автор mobit, 11 лет назад, По-английски

Hello , I have a question and it's how should we find the number of groups of -1s in a sequence of 1s and -1s ...?

For example if we have the sequence of length n that n=5 like this :

-1 , 1 , -1 , -1 , 1

In this example we have two groups first group contains the first number and the second group contains the 3rd and 4th number .

Given N and the sequence can you please tell me the number of groups of -1s that are after each other ?

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