GOLANG_INTERVIEW Telegram 348
📌Максимальное среднее подмассива

Сложность: Easy

Условие задачи: Дан целочисленный массив nums, состоящий из n элементов и целого числа k.

Найдите непрерывный подмассив, длина которого равна k, который имеет максимальное среднее значение, и верните это значение. Будет принят любой ответ с ошибкой вычисления менее 10-5.

Пример:

Ввод:
nums = [1,12,-5,-6,50,3], k = 4
Вывод: 12.75000
Объяснение:

Ввод:
nums = [5], k = 1
Вывод: 5.00000

Решение

@golang_interview
👍92🔥1



tgoop.com/golang_interview/348
Create:
Last Update:

📌Максимальное среднее подмассива

Сложность: Easy

Условие задачи: Дан целочисленный массив nums, состоящий из n элементов и целого числа k.

Найдите непрерывный подмассив, длина которого равна k, который имеет максимальное среднее значение, и верните это значение. Будет принят любой ответ с ошибкой вычисления менее 10-5.

Пример:

Ввод:
nums = [1,12,-5,-6,50,3], k = 4
Вывод: 12.75000
Объяснение:

Ввод:
nums = [5], k = 1
Вывод: 5.00000

Решение

@golang_interview

BY Golang вопросы собеседований




Share with your friend now:
tgoop.com/golang_interview/348

View MORE
Open in Telegram


Telegram News

Date: |

The channel also called on people to turn out for illegal assemblies and listed the things that participants should bring along with them, showing prior planning was in the works for riots. The messages also incited people to hurl toxic gas bombs at police and MTR stations, he added. Co-founder of NFT renting protocol Rentable World emiliano.eth shared the group Tuesday morning on Twitter, calling out the "degenerate" community, or crypto obsessives that engage in high-risk trading. In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. Read now The main design elements of your Telegram channel include a name, bio (brief description), and avatar. Your bio should be:
from us


Telegram Golang вопросы собеседований
FROM American