Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
baoliay2008 opened this issue Feb 4, 2023 · 4 comments
Closed

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

baoliay2008 opened this issue Feb 4, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@baoliay2008
Copy link
Owner

baoliay2008 commented Feb 4, 2023

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 baoliay2008 added the bug Something isn't working label Feb 6, 2023
@baoliay2008 baoliay2008 changed the title Q3 and Q4 of "biweekly contest 73" are on backwards Q3 and Q4 of "biweekly contest 97" are on backwards Feb 18, 2023
@baoliay2008
Copy link
Owner Author

The identical issue pertains to weekly contest 341

@baoliay2008
Copy link
Owner Author

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.

@baoliay2008 baoliay2008 self-assigned this May 14, 2023
@MysteryHawk17
Copy link

@baoliay2008

Taking up this issue if this is not solved yet.

@baoliay2008
Copy link
Owner Author

@MysteryHawk17 This problem was resolved in 4cb7c18

Sorting by the new qi field works correctly, and I have republished the frontend code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants