baoliay2008 / lccn_predictor

LeetCode Contest Rating Prediction
https://lccn.lbao.site
MIT License
570 stars 22 forks source link

Q3 and Q4 of "biweekly contest 97" are on backwards #3

Open baoliay2008 opened 1 year ago

baoliay2008 commented 1 year ago

Problem Description

Currently, Q1-Q4 are sorted by credit at first and then by question_id.

But for "biweekly contest 97", Q3's question_id is bigger than Q4's question_id

db.getCollection('Question').find(
    {"contest_name" : "biweekly-contest-97"}, 
    {title:1, title_slug:1, credit:1, question_id:1, _id:0}
).sort({credit:1, question_id:1})

↩️

/* 1 */
{
    "question_id" : 2639,
    "credit" : 3,
    "title" : "Separate the Digits in an Array",
    "title_slug" : "separate-the-digits-in-an-array"
}

/* 2 */
{
    "question_id" : 2640,
    "credit" : 4,
    "title" : "Maximum Number of Integers to Choose From a Range I",
    "title_slug" : "maximum-number-of-integers-to-choose-from-a-range-i"
}

/* 3 */
{
    "question_id" : 2641,
    "credit" : 5,
    "title" : "Disconnect Path in a Binary Matrix by at Most One Flip",
    "title_slug" : "disconnect-path-in-a-binary-matrix-by-at-most-one-flip"
}

/* 4 */
{
    "question_id" : 2673,
    "credit" : 5,
    "title" : "Maximize Win From Two Segments",
    "title_slug" : "maximize-win-from-two-segments"
}

So, Q3 and Q4 are misplaced.

Screen Shot 2023-02-05 at 00.53.13.png

Observed Time

Sun Feb 5 00:51:31 UTC+8, 2023

Possible Solution

baoliay2008 commented 1 year ago

The identical issue pertains to weekly contest 341

baoliay2008 commented 1 year ago

Solution: After examining the fetched question data, I discovered that there is another 'id' field present. Sorting the data by this additional 'id' field should resolve the issue at hand.