楼主:
dont 2025-02-07 21:43:233160. Find the Number of Distinct Colors Among the Balls
## 思路
两个hash map
一个纪录球的颜色, 一个纪录每种颜色的个数
每次QUERY更新两个map
如果球颜色改变, 就减掉原本颜色个数
## Code
```cpp
class Solution {
public:
vector<int> queryResults(int limit, vector<vector<int>>& queries) {
unordered_map<int, int> balls;
unordered_map<int, int> counter;
vector<int> res;
for (auto& query: queries) {
int b=query[0], c=query[1];
if (balls.find(b) != balls.end()) {
if (