Task 1: Toeplitz Matrix You are given an m x n matrix. Write a script to find out if the given matrix is a Toeplitz Matrix - a matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements. Example 1 Input: @matrix = [ [4, 3, 2, 1], [5, 4, 3, 2], [6, 5, 4, 3], ] Output: true Example 2 Input: @matrix = [ [1, 2, 3], [3, 2, 1], ] Output: false MY NOTES: sounds very easy. GUEST LANGUAGE: As a bonus, I also had a go at translating ch-1.pl into C (look in the C directory for that). Task 2: Split Same Average You are given an array of integers. Write a script to find out if the given can be split into two separate arrays whose average are the same. Example 1: Input: @nums = (1, 2, 3, 4, 5, 6, 7, 8) Output: true We can split the given array into (1, 4, 5, 8) and (2, 3, 6, 7). The average of the two arrays are the same i.e. 4.5. Example 2: Input: @list = (1, 3) Output: false MY NOTES: sounds easy enough as a brute force search. First observation: the "average of each sub-array" (our goal) must be the overall average, as that's the only way the sub-array averages can be the same value. Second observation: each element is either in the first subarray or in the second subarray, a binary counting approach is the obvious brute force method. (Note: I last did this in challenge 136, task 2, when we were summing subsets of Fibonacci numbers, so I've reused a little code from there). Third observation: we need only check one of the two sub-arrays (eg the first) as having the right sub-array average - the overall average. GUEST LANGUAGE: As a bonus, I also had a go at translating ch-2.pl into C (look in the C directory for that)