private boolean merge(int[] line) {
        
        int n = line.length;
        int cur = 0;
        int hand = -1;
        
        int zeroTail = 0;
        for (int i = n - 1; i >= 0; i--) {
            if (line[i] == 0)
                zeroTail++;
            else
                break;
        }
        
        for (int i = 0; i < n; i++) {
            if (line[i] == 0) {
                continue;
            }
            if (hand == -1) {
                hand = line[i];
                continue;
            }
            if (hand != line[i]) {
                line[cur++] = hand;
                hand = line[i];
            } else {
                line[cur++] = ++hand;
                if (hand >= WIN_NUM)
                    win = true;
                hand = -1;
            }
        }
        if (hand != -1)
            line[cur++] = hand;
        zeroTail = n - zeroTail - cur;
        for (; cur < n; cur++)
            line[cur] = 0;
        return zeroTail > 0;
    }