---
# System prepended metadata

title: '[LeeteCode - Biweekly Contest 50](https://leetcode.com/contest/biweekly-contest-50)'
tags: [LeetCode Contest]

---

---
titile: Biweekly Contest 50
tags: LeetCode Contest
---

[LeeteCode - Biweekly Contest 50](https://leetcode.com/contest/biweekly-contest-50)
===

Q1 - Minimum Operations to Make the Array Increasing
---

```cpp=
class Solution {
public:
    int minOperations(vector<int>& nums) {
        
        int ret = 0, cur = 0;
        for(int num: nums){
            if(cur >= num){
                
                ret += cur - num;
                cur ++;
            }else{
                cur = num + 1;
            }
            // cout<<cur<<endl;
        }
        
        
        return ret;
    }
};

```

Q2 - Queries on Number of Points Inside a Circle
---

```cpp=
class Solution {
public:
    vector<int> countPoints(vector<vector<int>>& points, vector<vector<int>>& queries) {
        vector<int> ret(queries.size());
        int i = 0;
        for(auto& querie: queries){
            int counter = 0;
            for(auto& point: points){
                if(pow(point[0] - querie[0], 2) + pow(point[1] - querie[1], 2) <= querie[2] * querie[2]){
                    counter++;
                }
            }
            ret[i++]= counter;
        }
        
        return ret;
    }
};
```

Q3 - 5719. Maximum XOR for Each Query
---

```cpp=
class Solution {
public:
    vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {
        vector<int> ret(nums.size());
        
        int cur = 0;
        const int MASK = (1 << maximumBit) - 1;
        for(int num: nums){
            cur = (cur ^ num);
        }
        
        for(int i = 0; i < nums.size(); i++){
            // cout<<cur<<endl;
            
            ret[i] = cur ^ MASK;
            cur = (cur ^ nums[nums.size() - i - 1]); 
        }
        
        return ret;
    }
};
```

Q4 -  
---

```cpp=

```
