#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> smallerNumbersThanCurrent(vector<int>& nums) {
vector<int> res;
for(int i = 0; i < nums.size(); i ++){
int e = 0;
for(int j = 0; j < nums.size(); j ++)
e += (nums[j] < nums[i]);
res.push_back(e);
}
return res;
}
};
int main() {
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> smallerNumbersThanCurrent(vector<int>& nums) {
vector<int> count(101, 0);
for(int e: nums) count[e] ++;
for(int i = 1; i <= 100; i ++) count[i] += count[i - 1];
vector<int> res;
for(int num: nums) res.push_back(num ? count[num - 1] : 0);
return res;
}
};
int main() {
return 0;
}