I just Copied a Python code to CPP one😒🤦‍♂️
Code\ncpp []\n#include <vector>\n#include <algorithm>\n\nclass Solution {\npublic:\n    int countOfPairs(std::vector<int>& nums) {\n        int n = nums.size();
# Code\n```cpp []\n#include <vector>\n#include <algorithm>\n\nclass Solution {\npublic:\n    int countOfPairs(std::vector<int>& nums) {\n        int n = nums.size();\n        int mn = nums[0];\n        nums.erase(nums.begin());\n\n        int num1 = 0, num2 = mn;\n\n        for (int num : nums) {\n            \n            if (num < num1) return 0;\n\n            if (num > num1 + num2) num1 = num - num2;\n            \n            num2 = num - num1;\n\n            if (num2 < mn) mn = num2;\n        }\n        return comb(n + mn, mn) % 1000000007;\n    }\n\nprivate:\n    long long comb(int n, int k) {\n        std::vector<long long> fact(n + 1, 1);\n        for (int i = 2; i <= n; i++) {\n            fact[i] = (fact[i - 1] * i) % 1000000007;\n        } \n        return fact[n] * modInverse(fact[k]) % 1000000007 * modInverse(fact[n - k]) % 1000000007;\n    }\n    long long modInverse(long long x) {\n        return power(x, 1000000007 - 2, 1000000007);\n    }\n    long long power(long long x, long long y, long long p) {\n        long long res = 1;\n        x = x % p;\n        while (y > 0) {\n            if (y & 1) res = (res * x) % p;\n            y = y >> 1;\n            x = (x * x) % p;\n        }\n        return res;\n    }\n};\n\n```
['C++']