๐ WAYPOINT LESSON
Checkpoint โ Arrays
โญ beginnerโณ 20 min read๐ Lesson 29 of 85
A moving average and a palindrome probe: transform loops and in-place two-pointer work.
Checkpoint: signal tools
Task: implement two methods:
static double[] MovingAverage(int[] readings, int window)โ the average of each contiguouswindow-sized slice:results[i]is the mean ofreadings[i..i+window]. The result hasreadings.Length - window + 1entries; when that count is โค 0 (window bigger than the input) return an empty array.windowmust be โฅ 1 or throwArgumentException.static bool IsPalindrome(int[] values)โ true when the array reads the same forwards and backwards (compare elementiwith elementLength-1-i, no new array). Null is not a palindrome; empty is.