Terralogic interview question

Matrix and Sorting based questions