ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Flip

Автор: Code with Alisha

Загружено: 2021-09-27

Просмотров: 15322

Описание: Timestamps:
0:00 Reading the problem
2:30 Explaining intuition
3:30 Kadane Algorithm
6:00 Kadane Code and Dry Run
10:30 Example dry run
13:02 Code CPP

Input Format
First and only argument is a string A.



Output Format
Return an array of integers denoting the answer.



Example Input
Input 1:

A = "010"
Input 2:

A = "111"


Example Output
Output 1:

[1, 1]
Output 2:

[]


Example Explanation
Explanation 1:

A = "010"


Pair of [L, R] | Final string
___________|_________
[1 1] | "110"
[1 2] | "100"
[1 3] | "101"
[2 2] | "000"
[2 3] | "001"



We see that two pairs [1, 1] and [1, 3] give same number of 1s in final string. So, we return [1, 1].

Explanation 2:

No operation can give us more than three 1s in final string. So, we return empty array [].

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Flip

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Kadane's Algorithm | Maximum Subarray Sum | Finding and Printing

Kadane's Algorithm | Maximum Subarray Sum | Finding and Printing

Minimum Lights To Activate #InterviewBit || Intuition + Code + Example

Minimum Lights To Activate #InterviewBit || Intuition + Code + Example

Maximum Ones after Modification InterviewBit Code + Examples C++

Maximum Ones after Modification InterviewBit Code + Examples C++

Азербайджан и Россия — дальше будет хуже | Рейды в Екатеринбурге, задержания в Баку

Азербайджан и Россия — дальше будет хуже | Рейды в Екатеринбурге, задержания в Баку

11. Container With Most Water || LEETCODE || code + intuition

11. Container With Most Water || LEETCODE || code + intuition

Конфликт России и Азербайджана | Заступится ли Путин за россиян (English subtitles) @Max_Katz

Конфликт России и Азербайджана | Заступится ли Путин за россиян (English subtitles) @Max_Katz

Я Добыл Самое Сильное Оружие в Майнкрафте

Я Добыл Самое Сильное Оружие в Майнкрафте

I made the PC I couldn't buy

I made the PC I couldn't buy

995, 3191, 3192 Minimum Number of K Consecutive Bit Flips | Bit Manipulation | Sliding Wind | Greedy

995, 3191, 3192 Minimum Number of K Consecutive Bit Flips | Bit Manipulation | Sliding Wind | Greedy

Number of Submatrices that Sum to Target - Leetcode 1074 - Python

Number of Submatrices that Sum to Target - Leetcode 1074 - Python

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]