TIME O(n), SPACE (1) || C++ || EASY TO UNDERSTAND || SHORT & SWEET
\n/*\ni E to [1,n]\nreach at ith day if nums[j]<=i+1 than add nums[j] into i  else add i+1 in to ith day\n*/\nclass Solution {\npublic:\n    int minPatches(vect
````\n/*\ni E to [1,n]\nreach at ith day if nums[j]<=i+1 than add nums[j] into i  else add i+1 in to ith day\n*/\nclass Solution {\npublic:\n    int minPatches(vector<int>& nums, int n) {\n        long long sum = 0, cnt = 0, i = 0;\n        while(sum<n){\n            if(i<nums.size()&&nums[i]<=sum+1){\n                sum += nums[i++];\n            }else{\n                cnt++;\n                sum += sum+1;\n            }\n        }\n        return cnt;\n    }\n};\n````
['Array', 'Greedy', 'C', 'C++']