skygragon / leetcode-cli

A cli tool to enjoy leetcode!
MIT License
3.64k stars 457 forks source link

leetcode submit 98 cpp : HTTP error #53

Closed yefeiw closed 7 years ago

yefeiw commented 7 years ago

Problem Summary

yefeiw@yefeiw-linux:/local/mnt/workspace/practice/java/bloomberg$ leetcode submit 62.unique-paths.cpp ✔ Accepted ✔ 61/61 cases passed (3 ms) yefeiw@yefeiw-linux:/local/mnt/workspace/practice/java/bloomberg$ leetcode submit 98.validate-binary-search-tree.cpp ERROR: http error yefeiw@yefeiw-linux:/local/mnt/workspace/practice/java/bloomberg$ leetcode version 0.9.0 yefeiw@yefeiw-linux:/local/mnt/workspace/practice/java/bloomberg$ leetcode submit 98.validate-binary-search-tree.cpp ERROR: http error

How to reproduce

Environment

skygragon commented 7 years ago

@yefeiw please use -vv to run submit again, it will show more info of the HTTP protocol. Also I guess it might be similar with #41, please check your 98.validate-binary-search-tree.cpp to see if there is special unicode char in the file.

yefeiw commented 7 years ago

Hi Sky,

Thanks for the reply. I think it mostly has something to do with my -x option. I wonder by downloading the description it makes the difference.

If that is the case, maybe I would like to recommend the contributors to test problem 98 with -x and then see if they can submit? If not, then maybe we need to do something extra to check the description for non-ascii chars?

Best, Sonass

skygragon commented 7 years ago

The "-x" param is used to add description as comment in the generated source file. If the description has illegal chars it will failed the submit command. The recent leetcode.com has changed its html format thus we failed to parse the right description for some questions.

Our latest 0.10.1 release should fixed this issue, I would suggest you try the latest leetcode-cli and DO clean your cache for that specific problem: e.g. ~/.lc/validate-binary-search-tree.json