For this Question: There are N candies, i<sup>th</sup> of them costing p<sub>i</sub>. You have M amount of money with you. Find the maximum number of candies you can buy.The first line of the input contains two integers N and M.
The second line of the input contains N space seperated integers.

Constraints:
1 <= N <= 10<sup>5</sup>
1 <= M <= 10<sup>14</sup>
1 <= p<sub>i</sub> <= 10<sup>9</sup>Print the maximum number of candies you can buy.Sample Input:
4 7
3 1 4 2

Sample Output:
3, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    int n, m;
    cin >> n >> m;
    vector<int> p(n);
    for(auto &i : p) cin >> i;
    sort(p.begin(), p.end());
    int cur = 0, ans = 0;
    for(int i = 0; i < n; i++){
        if(cur + p[i] > m){
            break;
        }
        cur += p[i];
        ans++;
    }
    cout << ans;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?