clearloop / leetcode-cli

May the code be with you 👻
MIT License
317 stars 54 forks source link

Bug report: wrong code template for 122.best-time-to-buy-and-sell-stock-ii.cpp #92

Closed theidexisted closed 2 years ago

theidexisted commented 2 years ago

To reproduce:

leetcode e 122

We get the source file name: ~/.leetcode/code/122.best-time-to-buy-and-sell-stock-ii.cpp

But with wrong content:

/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
 *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
 *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 * };
 */
class Solution {
public:
    vector<vector<int>> zigzagLevelOrder(TreeNode* root) {

    }
};

Find with version: leetcode-cli 0.3.11

theidexisted commented 2 years ago

I have checked the cached database file and see that the code template stored is wrong in the database.

So maybe:

wendajiang commented 2 years ago

Can you try run this command leetcode data -u ? And re-run leetcode e 122

theidexisted commented 2 years ago

Can you try run this command leetcode data -u ? And re-run leetcode e 122

I have tried but still, get the same result. Thanks!

wendajiang commented 2 years ago

Remove the cache file and re-generate the cache is ok? As I can not reproduce this problem.

theidexisted commented 2 years ago

Remove the cache file and re-generate the cache is ok? As I can not reproduce this problem.

Maybe you are using the dev branch(Not the same one as I used:0.3.11)?

wendajiang commented 2 years ago

I use the master branch and build target. Indeed it is not the github release version.