Leetcode Find The Maximum And Minimum Element In An Array Do The Groups