Title: Solution is being submitted to the wrong problem. · Issue #23 · fspv/python-leetcode · GitHub
Open Graph Title: Solution is being submitted to the wrong problem. · Issue #23 · fspv/python-leetcode
X Title: Solution is being submitted to the wrong problem. · Issue #23 · fspv/python-leetcode
Description: I have been trying to submit solutions but they keep getting submitted to the wrong problem/contest. Take an example using the snippet below. This code is supposed to be submitted to the walking-robot-simulation-ii problem which is quest...
Open Graph Description: I have been trying to submit solutions but they keep getting submitted to the wrong problem/contest. Take an example using the snippet below. This code is supposed to be submitted to the walking-ro...
X Description: I have been trying to submit solutions but they keep getting submitted to the wrong problem/contest. Take an example using the snippet below. This code is supposed to be submitted to the walking-ro...
Opengraph URL: https://github.com/fspv/python-leetcode/issues/23
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Solution is being submitted to the wrong problem.","articleBody":"I have been trying to submit solutions but they keep getting submitted to the wrong problem/contest. Take an example using the snippet below. This code is supposed to be submitted to the `walking-robot-simulation-ii` problem which is questionId, 2069. But for some reason, it is always submitted to a different problem: `kth-smallest-subarray-sum`. I verified this by checking the latest submission on my submissions on the leetcode website. I have tried this on other problems as well and it get it right on some occasions e.g.\"two sum\" and fail multiple times on others. What could be the reason and can you reproduce this on your side?\n```python\nimport os\nimport leetcode\nfrom leetcode.api_client import ApiClient\nfrom leetcode.configuration import Configuration\n\nconfiguration = Configuration()\nleetcode_session = os.getenv(\"LEETCODE_SESSION_ID\")\ncsrf_token = os.getenv(\"LEETCODE_CSRF_TOKEN\")\n\nconfiguration.api_key[\"x-csrftoken\"] = csrf_token\nconfiguration.api_key[\"csrftoken\"] = csrf_token\nconfiguration.api_key[\"LEETCODE_SESSION\"] = leetcode_session\nconfiguration.api_key[\"Referer\"] = \"https://leetcode.com\"\nconfiguration.debug = False\nconfiguration.api_key_prefix[\"Authorization\"] = \"Bearer\"\n\ncode = \"\"\"\n from typing import List, Tuple\n class Robot:\n def __init__(self, width: int, height: int):\n self.pos: List[Tuple[List[int], str]] = []\n self.pos.append(([0, 0], \"South\"))\n for i in range(1, width):\n self.pos.append(([i, 0], \"East\"))\n for j in range(1, height):\n self.pos.append(([width - 1, j], \"North\"))\n for i in range(width - 2, -1, -1):\n self.pos.append(([i, height - 1], \"West\"))\n for j in range(height - 2, 0, -1):\n self.pos.append(([0, j], \"South\"))\n self.isOrigin: bool = True\n self.i: int = 0\n\n def step(self, num: int) -> None:\n self.isOrigin = False\n self.i = (self.i + num) % len(self.pos)\n\n def getPos(self) -> List[int]:\n return self.pos[self.i][0]\n\n def getDir(self) -> str:\n return \"East\" if self.isOrigin else self.pos[self.i][1]\n \"\"\"\n\nsubmission = leetcode.Submission(\n typed_code=code,\n judge_type=\"large\",\n question_id=2069,\n test_mode=False,\n lang=\"python\",\n)\n\napi_instance = leetcode.DefaultApi(ApiClient(configuration))\n\nsubmission_id = api_instance.problems_problem_submit_post(\n problem=\"walking-robot-simulation-ii\", body=submission\n)\nprint(submission_id)\n```\n\nAdditionally, when you try to get the result from the `submission_result = api_instance.submissions_detail_id_check_get(id=submission_id)`, you will get an error.","author":{"url":"https://github.com/jpangas","@type":"Person","name":"jpangas"},"datePublished":"2025-03-17T19:33:19Z","url":"https://github.com/fspv/python-leetcode/issues/23"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5c2cf50c-605e-9ae3-2dfc-3b4bd81318f7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84FA:69535:BC0120:10A1983:6AEC6FB0 |
| html-safe-nonce | 61bef3f0a64103de7992924e93efcdaa900f66bdef032a5e0d90d0cc2b56b00a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEZBOjY5NTM1OkJDMDEyMDoxMEExOTgzOjZBRUM2RkIwIiwidmlzaXRvcl9pZCI6IjY1MTE3ODg4MzMzOTU5OTQ1NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 56c7a8692026d101443d3866a6d8936bb19efa9b81c44f70808c0a1bc7be9eaa |
| hovercard-subject-tag | issue:2926162065 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fspv/python-leetcode/23/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f3bfc1b0ae8c36a552cf504dce72a25751d9266d6b3793316488acee2dc3ed43/fspv/python-leetcode/issues/23 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f3bfc1b0ae8c36a552cf504dce72a25751d9266d6b3793316488acee2dc3ed43/fspv/python-leetcode/issues/23 |
| og:image:alt | I have been trying to submit solutions but they keep getting submitted to the wrong problem/contest. Take an example using the snippet below. This code is supposed to be submitted to the walking-ro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jpangas |
| hostname | github.com |
| expected-hostname | github.com |
| None | 81a8a223b8411e760195a15942ff045b37d56328f5bf02c4ca5f903e3dcb475e |
| turbo-cache-control | no-preview |
| go-import | github.com/fspv/python-leetcode git https://github.com/fspv/python-leetcode.git |
| octolytics-dimension-user_id | 1616237 |
| octolytics-dimension-user_login | fspv |
| octolytics-dimension-repository_id | 388199446 |
| octolytics-dimension-repository_nwo | fspv/python-leetcode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 388199446 |
| octolytics-dimension-repository_network_root_nwo | fspv/python-leetcode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a2c6dc5933515805b39ac7c5b9ab4e947c2f5a42 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width