#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
bool canDivideIntoSubsequences(vector<int>& nums, int K) {
unordered_map<int, int> freq;
int count = 0;
for(int e: nums){
freq[e] ++;
count = max(count, freq[e]);
}
return nums.size() / count >= K;
}
};
int main() {
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
bool canDivideIntoSubsequences(vector<int>& nums, int K) {
int count = 0;
for(int start = 0, i = start + 1; i <= nums.size(); i ++)
if(i == nums.size() || nums[i] != nums[start]){
count = max(count, i - start);
start = i;
i = start;
}
return nums.size() >= K * count;
}
};
int main() {
return 0;
}