carsonSgit / leetcode

leetcode grind... doing whatever I can to make sure I'm not bad at CS.
4 stars 0 forks source link

feat: Add Q643 Solution and Guide #46

Closed carsonSgit closed 2 months ago

carsonSgit commented 2 months ago

What is this problem

You are given an integer array nums consisting of n elements, and an integer k.

Find a contiguous subarray whose length is equal to k that has the maximum average value and return this value. Any answer with a calculation error less than 10-5 will be accepted.

How do I solve it

Breakdown:

  1. Implement the sliding window technique.

Resources

https://www.youtube.com/watch?v=UdUUnoiLkPg -- Guide I first solved with and then branched off of.