Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit de88757

Browse files
committed
Update doc for lintcode plugin.
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent d8a0043 commit de88757

File tree

3 files changed

+92
-4
lines changed

3 files changed

+92
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# leetcode-cli-plugins
22
3rd party plugins for leetcode-cli.
33

4-
* [company.js](/docs/company.md)
5-
* [cpp.lint.js](/docs/cpp.lint.md)
6-
* [cpp.run.js](/docs/cpp.run.md)
4+
* [company](/docs/company.md)
5+
* [cpp.lint](/docs/cpp.lint.md)
6+
* [cpp.run](/docs/cpp.run.md)
7+
* [lintcode](/docs/lintcode.md)
78
* [solution.discuss](/docs/solution.discuss.md)
89

910
## HOWTO

docs/lintcode.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# lintcode (WIP)
2+
3+
Plugin to provide `lintcode-cli` to work with lintcode.com.
4+
5+
Support similar commands as leetcode:
6+
7+
* `list`
8+
* `show`
9+
* `test`
10+
* `submit`
11+
* `user`
12+
13+
## NOTE
14+
15+
1. when enabled, it will hide existing leetcode plugin, thus everything is working against lintcode.com (including user/problems cache, etc).
16+
2. lintcode.com itself seems has bug in running test? The expected answer returned is not right!
17+
18+
## Usage
19+
20+
### list
21+
22+
$ leetcode list -q e array
23+
✔ [548] Intersection of Two Arrays II Easy (21.00 %)
24+
✔ [547] Intersection of Two Arrays Easy (23.00 %)
25+
✔ [373] Partition Array by Odd and Even Easy (41.00 %)
26+
✔ [177] Convert Sorted Array to Binary Search Tree With Minimal Height Easy (32.00 %)
27+
✔ [138] Subarray Sum Easy (30.00 %)
28+
✔ [101] Remove Duplicates from Sorted Array II Easy (30.00 %)
29+
✔ [100] Remove Duplicates from Sorted Array Easy (31.00 %)
30+
✔ [ 64] Merge Sorted Array Easy (34.00 %)
31+
✔ [ 50] Product of Array Exclude Itself Easy (27.00 %)
32+
✔ [ 44] Minimum Subarray Easy (38.00 %)
33+
✔ [ 41] Maximum Subarray Easy (39.00 %)
34+
✔ [ 39] Recover Rotated Sorted Array Easy (27.00 %)
35+
✔ [ 6] Merge Two Sorted Arrays Easy (36.00 %)
36+
37+
### show
38+
39+
$ leetcode show 6 -gx
40+
[6] Merge Two Sorted Arrays
41+
42+
http://www.lintcode.com/en/problem/merge-two-sorted-arrays/
43+
44+
* lintcode
45+
* Easy (36.00%)
46+
* Source Code: 6.merge-two-sorted-arrays.cpp
47+
* Testcase Example: '[1]\n[1]\n'
48+
49+
Merge two given sorted integer array A and B into a new sorted integer array.
50+
Example
51+
A=[1,2,3,4]
52+
B=[2,4,5,6]
53+
return [1,2,2,3,4,4,5,6]
54+
Challenge
55+
How can you optimize your algorithm if one array is very large and the other is very small?
56+
57+
### test
58+
59+
$ leetcode test 6.merge-two-sorted-arrays.cpp
60+
61+
Input data:
62+
[1]
63+
[1]
64+
65+
66+
Actual
67+
✔ runtime: 11 ms
68+
✔ answer: '[1,1]'
69+
✔ stdout: ''
70+
71+
Expected
72+
✔ answer: '[1,1]'
73+
✔ stdout: ''
74+
75+
### submit
76+
77+
$ leetcode submit 6.merge-two-sorted-arrays.cpp
78+
✔ Accepted
79+
✔ 11/11 cases passed (162 ms)
80+
[WARN] Failed to get submission beat ratio.

plugins/lintcode.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,15 @@ plugin.submitProblem = function(problem, cb) {
304304
});
305305
};
306306

307+
plugin.getSubmissions = function(problem, cb) {
308+
return cb('Not implemented');
309+
};
310+
307311
plugin.getSubmission = function(submission, cb) {
308-
// FIXME
312+
return cb('Not implemented');
313+
};
314+
315+
plugin.starProblem = function(problem, starred, cb) {
309316
return cb('Not implemented');
310317
};
311318

0 commit comments

Comments
 (0)