Possible mass plagiarism on Leetcode Weekly Contest 293

If anyone noticed, the number of accepted suddenly boomed up in the last 15 minutes or so for question 4

Looking at leaderboard, I see many accounts submissions with the name starting with __1915xxxxx

The solutions are mostly exactly the same as well lol

Please look into this. Thanks

image

This is the plagarised code for
Q3

class Solution {
    public int largestCombination(int[] candidates) {
        int n=candidates.length;
        int bit[] = new int[32]; 
        for (int i = 0; i < n; i++) {
            int x1 = 31;
            while (candidates[i] > 0) {
                if ((int)(candidates[i] & 1) == (int)1) {
                    bit[x1]++;
                }
                candidates[i] = candidates[i] >> 1;
                x1--;
            }
        }
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < 32; i++) {
            max = Math.max(max, bit[i]);
        }
        return max;
    }
}

Q4

class Node{
    public:
    int val;
    int lazy;
    Node* left;
    Node* right;
    int tl,tr;
    Node(int l, int r){
        val = 0;
        lazy = 0;
        left = NULL;
        right = NULL;
        tl = l;
        tr = r;
    }
    
    void push(){
        int tm = (this->tl + this->tr)/2;
        if(this->left == NULL || this->right == NULL){
            this->left = new Node(this->tl,tm);
            this->right = new Node(tm+1,this->tr);
        }
        
        if(this->lazy){
            this->left->lazy = 1;
            this->right->lazy = 1;
            this->left->val = tm - this->tl + 1;
            this->right->val = this->tr - (tm+1) + 1;
            this->lazy = 0;
        }
    }
    
    int query(int l, int r){
        if(l>r || r<this->tl || l>this->tr) return 0;
        if( l<= this->tl && r>= this->tr) return this->val;
        this->push();
        int ans = 0;
        if(this->left != NULL) ans += this->left->query(l,r);
        if(this->right != NULL) ans += this->right->query(l,r);
        return ans;
    }
    
    void update(int l, int r){
        if(l>r || r<this->tl || l>this->tr) return;
        if( l<= this->tl && r>= this->tr){
            this->val = this->tr-this->tl+1;
            this->lazy = 1;
            return;
        }
        this->push();
        if(this->left != NULL)
        this->left->update(l,r);
        if(this->right != NULL)
        this->right->update(l,r);
        this->val = 0;
        if(this->left != NULL) this->val += this->left->val;
        if(this->right != NULL) this->val += this->right->val;
    }
};

class CountIntervals {
public:
    Node* root;
    CountIntervals() {
        root = new Node(1,1000000000);
    }
    
    void add(int left, int right) {
        root->update(left,right);
    }
    
    int count() {
        return root->query(1,1000000000);
    }
};
Comments (29)