Java Greedy 100% Faster
```\n\tpublic int minPatches(int[] nums, int n) {\n        int patches= 0;\n        long sum= 0, limit= (long)n;\n        for(int i=0; i=limit) break;\n        
```\n\tpublic int minPatches(int[] nums, int n) {\n        int patches= 0;\n        long sum= 0, limit= (long)n;\n        for(int i=0; i<nums.length; i++){\n            if(sum>=limit) break;\n            if(sum+1<nums[i]){\n                i--; patches++;\n                sum+= sum+1;\n            }else sum+= (long)nums[i];\n        }\n        while(sum<limit){\n            sum+= sum+1; patches++;\n        }\n        return patches;\n    }
[]