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

CF Problem Sheet Backend API added #76

Merged
merged 1 commit into from
Dec 4, 2023
Merged

Conversation

Harsha9554
Copy link
Contributor

This PR address the feature request issue #74 and it's sub issue which is #75 to develop a CodeForces Problem Sheet Backend API.

Here's why this PR would be a game-changer for our CP group:

  1. Targeted Skill Improvement:

    • Ever felt the need to hone your skills in a particular rating range? With this feature, you can tailor your practice to match your current level and challenge yourself to the next one.
  2. Latest Contest Insights:

    • Stay ahead of the game by accessing problems from the most recent contests. The feature will intelligently order problems so that you can grasp the latest patterns and strategies employed in the recent contests.
  3. Efficient Problem Management:

    • No more sifting through irrelevant problems. Easily distinguish between problems you've solved, attempted, or haven't touched. It's a streamlined approach to managing your problem-solving journey.

Features Handled in this PR:

  1. Fetch Problems by Rating Range:

    • Users should be able to fetch all problems from recent contests within a given rating range (e.g., 1100 to 1200).
    • The fetched problems should be ordered based on the most recent contests, providing insight into the latest contest patterns.
  2. Distinguish Problem Status:

    • Users should have the ability to distinguish between problems they have solved, attempted, and so on.
    • This feature enhances the user experience by providing a clear overview of their progress.

Design for the API call:

API Endpoint:

GET http://localhost:3000/api/cf-problem-sheet

Query Parameters:

  • handle (required): Codeforces handle of the user.
  • minProblemRating (optional): Minimum problem rating.
  • maxProblemRating (optional): Maximum problem rating.
  • numberOfPreviousContests (optional): Number of previous contests to consider.

Example Request:

GET http://localhost:3000/api/cf-problem-sheet?handle=harsha_9554&maxProblemRating=1400&numberOfPreviousContests=3

Example Response:

{
    "meta": {
        "handle": "harsha_9554",
        "minProblemRating": 0,
        "maxProblemRating": 1400,
        "numberOfPreviousContests": 3
    },
    "problems": [
        {
            "contestId": 1903,
            "index": "A",
            "name": "Halloumi Boxes",
            "type": "PROGRAMMING",
            "points": 500,
            "rating": 800,
            "tags": [
                "brute force",
                "greedy",
                "sortings"
            ],
            "verdict": "NONE",
            "URL": "https://codeforces.com/problemset/problem/1903/A"
        },
        {
            "contestId": 1903,
            "index": "B",
            "name": "StORage room",
            "type": "PROGRAMMING",
            "points": 1000,
            "rating": 1200,
            "tags": [
                "bitmasks",
                "brute force",
                "constructive algorithms",
                "greedy"
            ],
            "verdict": "NONE",
            "URL": "https://codeforces.com/problemset/problem/1903/B"
        },
        {
            "contestId": 1903,
            "index": "C",
            "name": "Theofanis' Nightmare",
            "type": "PROGRAMMING",
            "points": 1500,
            "rating": 1400,
            "tags": [
                "constructive algorithms",
                "greedy"
            ],
            "verdict": "NONE",
            "URL": "https://codeforces.com/problemset/problem/1903/C"
        }
    ]
}

Finally, This PR solves #75, part of #74. Please review the changes and let me know if there are any issues or if further adjustments are needed. @Jaideep-C

@Jaideep-C Jaideep-C merged commit d1f0774 into c-code-x:alpha Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants