Ebay NG OA

Given a rectangular matrix m and an integer k, consider all the k k contiguos square submatrices of m. Your task is the following.
Calculate the sum of all numbers within each k
k submatrix.
Determine the maximum of all these sums
Find all the distinct numbers that appear in any of the squares wirh a sum equal to the maximum.Each integer from these squares should be calculated exactly once. Return the sum of these distinct numbers.
m =[[1,0,1,5,6],[3,3,0,3,3],[2,9,2,1,2],[0,2,4,2,0]]
k = 2 output =29