AlcoRhythm

AlcoRhythm 

Алгоритмы и Структуры данных

11subscribers

149posts

Showcase and bundles

3
A bundle is a collection, compilation, playlist, or catalog of posts that saves you from searching through the blog and lets you buy the entire content series in a single click.
goals1
$25.26 of $12.7 raised
На Балтику №(от 0 до 10) для видео :]

LeetCode - 485. Max Consecutive Ones

<<Назад | Программа курса | Далее>>
Задача для самостоятельной работы.
Не смотри видео ниже, пока не попробуешь сам.
Код на языке Swift
func findMaxConsecutiveOnes(_ nums: [Int]) -> Int {
    var maxCount = 0
    var currentCount = 0
    for num in nums {
        if num == 1 {
            currentCount += 1
        } else {
            maxCount = max(maxCount, currentCount)
            currentCount = 0
        }
    }
    maxCount = max(maxCount, currentCount)
    return maxCount
}
Subscription levels2

EasyPeasy / Проще некуда

$1.9 per month
Реквизит для "проще некуда"
Ищи по тегу easy-peasy

В РИТМЕ

$6.4 per month
Алгоритмы на практике:
- Поиск контактов в iPhone
- Задачи из списка Яндекс
Go up