BINARY SEARCH || C++ || SHORT & SWEET CODE
\nclass Solution {\npublic:\n    long long repairCars(vector<int>& ranks, int cars) {\n        int n = ranks.size();\n        for(int i = 0; i < n; i++){};\n   
```\nclass Solution {\npublic:\n    long long repairCars(vector<int>& ranks, int cars) {\n        int n = ranks.size();\n        for(int i = 0; i < n; i++){};\n        long long int mn = 1, mx = (1e14),mid,ans;\n        while(mn<=mx){\n            mid = (mx-mn)/2+mn;\n            long long int k = 0;\n            for(auto &i: ranks){\n                k += sqrt(mid/i);\n            }\n            if(k==cars){\n                ans = mid;\n                mx = mid-1;\n            }else if(k>cars){\n                ans = mid;\n                mx = mid-1;\n            }else{\n                mn = mid+1;\n            }\n            \n        }\n        return ans;\n    }\n};\n```
['Binary Search', 'C', 'C++']