Could anyone help to look at my code?

It passed 11/13 cases.

what is wrong with it?

Thank you so much.

```
class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
sort(nums.begin(),nums.end());
int size = nums.size();
int sum = 0;
int count = 0;
for(int i = size-1; i >= 0; i--)
{
sum = sum + nums[i];
count++;
if(sum >= s) break;
}
if(count == size) return 0;
else
return count;
}
};
```