Giter VIP home page Giter VIP logo

leetcode-cli's People

Contributors

csvwolf avatar eindex avatar fanzhenya avatar heshamsafi avatar jdneo avatar liaoziyang avatar nnnevermore avatar poppinlp avatar si-yao avatar skygragon avatar sparklescn avatar sunwayforever avatar sykuang avatar wong2 avatar wszk1992 avatar zestze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leetcode-cli's Issues

Error 403

when I test or submit the program, it returns error:ERROR: HTTP failed:403.

How could I figure it out?

test issue and submit beats ratio bugs

Problem Summary

  1. When use leetcode test ./.cpp -t testcase, it occurs error adding quotation marks on testcase, the command documentations may need changed :).
  2. How to use interactive command -i in test occasion, when I use leetcode test ./.cpp -i in Win10, I don't know what to do next and I tried some input, cmd didn't response.
  3. Why every time I submit, it gives me beats 100% of cpp submissions? Actually it didn't.

How to reproduce

Environment

  • leetcode-cli version:
  • Win10 professional version:
  • Node version: v8.1.4
  • Npm version: 5.0.3

List [Keyword] only works for lowercase letter

List [Keyword] only works for lowercase letter
e.g
Run "lc list Rotated", and there is no results.
Run "lc list rotated", it works correctly and shows:
[154] Find Minimum in Rotated Sorted Array II Hard (35.69 %)
[153] Find Minimum in Rotated Sorted Array Medium (37.96 %)
[ 81] Search in Rotated Sorted Array II Medium (32.66 %)
[ 33] Search in Rotated Sorted Array Hard (31.40 %)

leetcode submit 98 cpp : HTTP error

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

  • leetcode-cli version: 0.9.0
  • OS version: ubuntu 14.04
  • Node version: 7.10.0
  • Npm version: 4.2.0

Input test cases error

The second '\n' was not treated as a escape character

Repro:
Leetcode$ lc test reverse-linked-list-ii.java -t '[5]\n1\n1'

Input data:
[5]
1\n1

Your
✘ Runtime Error
✘ runtime: N/A
✘ output:

Expected
✘ Runtime Error
✘ runtime: N/A
✘ output:

Add language template ?

Will you add command to show language template?
Such as

class Solution {
public:
int lengthOfLongestSubstring(string s) {

}

};

in c++

submit problem error

When I use submit problems with golang, Leetcode give me the error '✘ Line 1: syntax error: non-declaration statement outside function body'


应该是**人吧英文不好, 我就说中文吧, 因为没有过滤函数体之外的一些代码, 所以会导致提交问题的编译错误, 比如:

package problems

import "strconv"

func fizzBuzz(n int) []string {
	res := []string{}
	for i := 1; i <= n; i++ {
		a := ""

		if i%5 != 0 && i%3 != 0 {
			a = strconv.FormatInt(int64(i), 10)
		} else {
			if i%3 == 0 {
				a = "Fizz"
			}
			if i%5 == 0 {
				a = a + "Buzz"
			}
		}
		res = append(res, a)
	}
	return res
}

Is there an option to change the name of the generated file

Problem Summary

Currently run leetcode show xx -g -x it will generate a file named "xx.xxx-xx-xx.java". However, Intellij IDEA will throw an error:

Error:(1, 8) java: class Solution is public, should be declared in a file named Solution.java.

Is there an option so that user can generate a file named "Solution.java"?

Thanks!

Some questions about the code

Hi, I found this tool on 1point3acres and I'm interested in improving it.

Since leetcode change their URL for problem list, your PROBLEM_URL is not working now. I figured out the new API URL and made some change.

Besides, I have two questions about your implementation:

  1. Why do you need to store the password as plain text in local file? Since we have the session id and other information which can keep login, it that still necessary?
  2. I notice that you cache all the problems in local file including the status of each problem. Once you store it, it will never be updated, include the status.

List questions by company tag?

Can we add an option to list questions by company tag?

For example:
leetcode list -c google

List all google questions.

Problem description is incomplete

Problem Summary

Can you solve this problem? �

How to reproduce

  1. run
    leetcode show 372
  2. Found the descript is incomplete:

Actual Results:

The problem description is incomplete and shows as below:
[372] Super Pow

https://leetcode.com/problems/super-pow

  • Medium (33.81%)
  • Total Accepted: 15200
  • Total Submissions: 44892
  • Testcase Example: '2\n[3]'

Expected Results
The problem description should be complete and same as https://leetcode.com/problems/super-pow/#/description

Pull detail msg for runtime error

When a submission got runtime error, there is no detail message return to the console. It would nice if leetcode-cli can pull the detail error msg.

/usr/bin/env: node: No such file or directory

Hello,
I have successfully installed leetcode-cli. Then when I run "leetcode list" or "leetcode help", the command failed with "/usr/bin/env: node: No such file or directory".
Do you know what's wrong here?
Thanks.

Jintao

Is it possible to refresh the list after login another computer?

I turned on "ALWAYS_LOGIN" for both my computers. When I submit from one of the computer and run "leetcode list" in another one, it still keeps the old list (without the submitted one). I wonder if it's possible to refresh the list instead of using cache? Or do I have to run lc user -l each time?

Thanks!!

Got an error in submission

/usr/local/lib/node_modules/leetcode-cli/lib/commands/submit.js:60
          if (!submission.distributionChart) return;
                         ^

TypeError: Cannot read property 'distributionChart' of undefined
    at /usr/local/lib/node_modules/leetcode-cli/lib/commands/submit.js:60:26
    at /usr/local/lib/node_modules/leetcode-cli/lib/leetcode_client.js:201:19

It happens occasionally. I think the reason is that the leetcode_client.js getSubmission() call is not successful, and the callback function doesn't handle the error correctly: https://github.com/skygragon/leetcode-cli/blob/master/lib/commands/submit.js#L60

Perhaps adding a if (e) {} check to throw it.

Reopen Pull detail msg for runtime error

with latest build, still did not see runtime error in cli, so currently I have to login to web for debugging.

Test case:

leetcode test zigzag-conversion.java -t '[3,9,20,null,null,15,7]'

Actual Output:

Your
✘ Runtime Error
✘ runtime: N/A
✘ output:

Expected
✘ Runtime Error
✘ runtime: N/A
✘ output:

Excepted output
Line 21: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

public class Solution {
public List zigzagLevelOrder(TreeNode root) {
List res = new ArrayList();
dfs(root, 0, res);
return res;
}

public void dfs (TreeNode node, Integer level, List res ){
if (node == null){
return;
}
List levelNodes = res.get(level);
if (res.get(level) == null){
levelNodes = new ArrayList();
res.add(levelNodes);
}

//right; left
if (level % 2 == 1){
levelNodes.add(0, node.val);
}
else {
levelNodes.add(node.val);
}
dfs(node.left, level+1, res);
dfs(node.right, level+1, res);
}
}

login problems

It seems that leetcode had updated it's anti-crawler strategy, so that I can login but can't get the problem list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.