✅Accepted || ✅Short & Simple || ✅Best Method || ✅Easy-To-Understand
\n# Code\n\nclass Solution {\npublic:\n    int minCapability(vector<int>& nums, int k) {\n        int l=nums[0], h=nums[0];\n        for(int i:nums)\n        {\
\n# Code\n```\nclass Solution {\npublic:\n    int minCapability(vector<int>& nums, int k) {\n        int l=nums[0], h=nums[0];\n        for(int i:nums)\n        {\n            l=min(l, i);\n            h=max(h, i);\n        }\n        int ans=INT_MAX;\n        while(l<=h)\n        {\n            int m=(l+h)/2;\n            int c=0, p=-2;\n            int g=0;\n            for(int i=0;i<nums.size();i++)\n            {\n                if(nums[i]<=m && p+1 != i)\n                {\n                    c++;\n                    p=i;\n                    g=max(g, nums[i]);\n                }\n            }\n            if(c>=k)\n            {\n                h=m-1;\n                ans=min(ans, g);\n            }\n            else\n            l=m+1;\n        }\n        return ans;\n    }\n};\n```\nPlease **UPVOTE** if it helps \u2764\uFE0F\uD83D\uDE0A\nThank You and Happy To Help You!!
['C++']