Added the implementation of the getMinArr and getMaxArr function