Skip to main content
๐Ÿ“œ 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:

  1. static double[] MovingAverage(int[] readings, int window) โ€” the average of each contiguous window-sized slice: results[i] is the mean of readings[i..i+window]. The result has readings.Length - window + 1 entries; when that count is โ‰ค 0 (window bigger than the input) return an empty array. window must be โ‰ฅ 1 or throw ArgumentException.
  2. static bool IsPalindrome(int[] values) โ€” true when the array reads the same forwards and backwards (compare element i with element Length-1-i, no new array). Null is not a palindrome; empty is.