Collect diagonal values from a 3x3 matrix into a new array.
Given a 3x3 integer matrix, return an array containing the primary diagonal followed by the secondary diagonal. Include the center value once for each diagonal, so the result contains six values.
Function signature: def collect_diagonals(matrix):
The input is a list of three lists, each containing three integers. Return a new list.
def collect_diagonals(matrix):