Amazon Interview Question

Find the smallest entry in matrix with given boundary