j178 / leetgo

Best LeetCode friend for geek. :snowboarder:
MIT License
539 stars 32 forks source link

support better answer judgement #110

Closed j178 closed 1 year ago

j178 commented 1 year ago
  1. judgement for questions without return value, they change the input parameter in-place, like https://leetcode.cn/problems/reorder-list/
  2. judgement for random order sequence, like https://leetcode.cn/problems/two-sum/,
w43322 commented 1 year ago

Another kind of problem: the output string is not standard https://leetcode.cn/problems/linked-list-cycle-ii/

j178 commented 1 year ago
  1. judgement for questions without return value, they change the input parameter in-place, like https://leetcode.cn/problems/reorder-list/

For this type of questions, there is actually a paramindex in questions' metadata:

{
  "name": "reorderList",
  "params": [
    {
      "name": "head",
      "type": "ListNode"
    }
  ],
  "return": {
    "type": "void"
  },
  "output": {
    "paramindex": 0
  }
}

we can use this info to serialize the corresponding paramater as output.

j178 commented 1 year ago

a new special case: https://leetcode.cn/problems/find-positive-integer-solution-for-a-given-equation/ this function takes a function as first parameter 🤯

w43322 commented 1 year ago

https://leetcode.cn/problems/first-bad-version/ https://leetcode.cn/problems/implement-rand10-using-rand7/

Also there are problems with pre-defined APIs.

j178 commented 1 year ago

We can use a little script to get some hints about these pre-definied function:

image