{ "info": { "author": "Pengcheng Chen", "author_email": "pengcheng.chen@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2" ], "description": "# LeetCode CLI\n\nStart `tmux`, `vim` and `leetcode-cli`. Practice as many questions as you can:-)\n\nThis tool is not affiliated with [LeetCode](https://leetcode.com).\n\n## Install\n\n### Mac OS X\n\n```\nbrew install node\nsudo easy_install leetcode-cli\n```\n\n### Linux\n\n```\nsudo apt install nodejs\nsudo pip install leetcode-cli\n```\n\n## Usage\n\nThe most common commands are: `cd`, `ls`, `pull`, `cat`, `check`, `push`, `cheat`, `clear` and `/`.\n\n```\n$ leetcode-cli\n\nUsername: student\nPassword:\nWelcome student!\n (\\_/)\n=(^.^)=\n(\")_(\")\n243 solved 17 failed 523 todo\n\n#:/> ?\ncat - Show test case(s).\ncd - Change problem(s).\ncheat - C.H.E.A.T.\ncheck - Test the solution.\nchmod - Change programming language.\nclear - Clear screen.\nfind - Find problems by keyword. Alias: /.\nlimit - Limit the number of problems.\nlogin - Login into the online judge.\nls - Show problem(s).\nprint [keyword] - Print problems by keyword in HTML.\npull [*] - Pull latest solution(s). '*': all problems.\npush - Submit the solution.\nsu - Change session.\n\nA tag can refer to a topic (e.g. array) or a company (e.g. amazon).\nA keyword can be anything (including a tag).\nCommands and options can be completed via .\n\n#:/>\n```\n\nControl+D to exit.\n\n## Demo\n\nAt the root (`/`) level. `ls` lists all the topics. `#` is for problems without a topic.\n\n```\n#:/> ls\n 29 #\n 81 array\n 28 backtracking <- 28 problems todo in backtracking\n 5 binary-indexed-tree\n 35 binary-search\n 12 binary-search-tree\n 26 bit-manipulation\n 3 brainteaser\n 31 breadth-first-search\n 60 depth-first-search\n...\n 13 sort\n 14 stack\n 62 string\n 3 topological-sort\n 53 tree\n 12 trie\n 21 two-pointers\n 9 union-find\n242 solved 18 failed 523 todo\n```\n\n`cd ` changes the current topic.\n\n```\n#:/> cd heap\n#:/heap>\n```\n\nAt the topic level, `ls` lists the problems by difficulty level and acceptance rate. Levels are seperated by a blank line. At each level, the problems are listed in the order of acceptance rate.\nThe marks: `*` means `todo`, `x` `failed`, none means `solved`.\n\n```\n#:/heap> ls\n 355 design-twitter <- the hardest\n *719 find-k-th-smallest-pair-distance\n *836 race-car\n 23 merge-k-sorted-lists\n *218 the-skyline-problem\n *803 cheapest-flights-within-k-stops\n\n 295 find-median-from-data-stream <- medium level\n *895 shortest-path-to-get-all-keys\n 373 find-k-pairs-with-smallest-sums\n...\n 215 kth-largest-element-in-an-array\n *692 top-k-frequent-words\n *794 swim-in-rising-water\n\n 378 kth-smallest-element-in-a-sorted-matrix <- easy level\n 347 top-k-frequent-elements\n 451 sort-characters-by-frequency\n *761 employee-free-time <- the easiest\n11 solved 0 failed 17 todo\n```\n\n`cd ` changes the current problem. Then `ls` shows the description.\n\n```\n#:/heap> cd 23\n#:/heap/23-merge-k-sorted-lists> ls\n[Linked-List, Heap, Divide-And-Conquer, 8/20]\n\nMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.\nExample:\n\nInput:\n[\n 1->4->5,\n 1->3->4,\n 2->6\n]\nOutput: 1->1->2->3->4->4->5->6\n```\n\n`pull` downloads the latest solution and sample test case from the online judge. If no solution was submitted, a boiler plate is used. The solution/boilerplate is saved in `./ws/.` and can be edited.\n\n```\n#:/heap/23-merge-k-sorted-lists> pull\n,___,\n[O.o] Replace working copy? (y/N)\n/)__)\n-\"--\"-y\nws/23.py\n```\n`cat` show the sample test case. It is saved in `./ws/tests.dat`. Test cases can be added to it and be used by `check`.\n\n```\n#:/heap/23-merge-k-sorted-lists> cat\nws/23.py << [[1,4,5],[1,3,4],[2,6]]\n```\n\nNow that we have the problem description and the sample test case, start coding and test the solution locally.\n\n```\n$ vim ./ws/23.py\n$ python ./ws/23.py\n```\n\nThe default programming language is `Python`. To change it, use `chmod `. Once the solution passes tests locally, we can `check` it with or `push` it to the online judge. `push` reports the runtime and number of tests passed.\n\n```\n#:/heap/23-merge-k-sorted-lists> check\nInput: [[1,4,5],[1,3,4],[2,6]]\nResult: [1,1,2,3,4,4,5,6]\nRuntime: 20 ms\n\n#:/heap/23-merge-k-sorted-lists> push\nRuntime % ms\n###############################################################################\n** 0 48\n***** 1 52\n***************** 2 56\n********************************************************************** 8 60\n*********************************************************************** 8 64*\n**************************************** 5 68\n*********************************************** 6 72\n*************************************************************** 7 76\n************************************** 4 80\n************************ 3 84\n**************** 2 88\n************** 2 92\n************ 1 96\n**************** 2 100\n***************** 2 104\n**************** 2 108\n*********************** 3 112\n******************************** 4 116\n************************ 3 120\n*********************** 3 124\n*********************** 3 128\n****************** 2 132\n********** 1 136\n********* 1 140\nRank: 20.51%\nResult: 131/131 tests passed\nRuntime: 64 ms\n```\n\n`/` searches for problems matching a tag (`airbnb`) or a keyword (e.g. `palindrome`)\n\n```\n#:/heap/23-merge-k-sorted-lists> cd ..\n#:/heap> cd ..\n#:/> /airbnb\n 220 contains-duplicate-iii\n 68 text-justification\n 10 regular-expression-matching\n x212 word-search-ii\n 269 alien-dictionary\n *336 palindrome-pairs\n 2 add-two-numbers\n 23 merge-k-sorted-lists\n *190 reverse-bits\n *803 cheapest-flights-within-k-stops\n\n 227 basic-calculator-ii\n 160 intersection-of-two-linked-lists\n *221 maximal-square\n 385 mini-parser\n 219 contains-duplicate-ii\n 20 valid-parentheses\n *756 pour-water\n 42 trapping-rain-water\n 1 two-sum\n 198 house-robber\n 251 flatten-2d-vector\n 415 add-strings\n 202 happy-number\n\n 108 convert-sorted-array-to-binary-search-tree\n *787 sliding-puzzle\n *757 pyramid-transition-matrix\n 217 contains-duplicate\n *752 ip-to-cidr\n *761 employee-free-time\n 136 single-number\n20 solved 1 failed 9 todo\n\n#:/>\n```\n\nThe solutions are saved in the `./ws/` directory.\n\n`print` generates a syntax-highlighted [HTML](http://www.spiderman.ly/all.html).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chenpengcheng/cli", "keywords": "leetcode", "license": "", "maintainer": "", "maintainer_email": "", "name": "leetcode-cli", "package_url": "https://pypi.org/project/leetcode-cli/", "platform": "", "project_url": "https://pypi.org/project/leetcode-cli/", "project_urls": { "Homepage": "https://github.com/chenpengcheng/cli" }, "release_url": "https://pypi.org/project/leetcode-cli/0.0.6/", "requires_dist": [ "ascii-graph", "bs4", "PyExecJS", "requests" ], "requires_python": "", "summary": "LeetCode CLI", "version": "0.0.6" }, "last_serial": 5235608, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "2a5d0607682b7f7b23339ebaba510325", "sha256": "f8554872887445134004d9d87539afca25ef1132ad14b378b9371cee05e199d1" }, "downloads": -1, "filename": "leetcode_cli-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2a5d0607682b7f7b23339ebaba510325", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16386, "upload_time": "2018-09-11T05:44:43", "url": "https://files.pythonhosted.org/packages/4d/06/78e60949e07cc799d340f756d6443b8741caff70d0864eef26e7ec140896/leetcode_cli-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48e14b17b8c3f5b9f8d4c5680fd05b3a", "sha256": "b3d88355b1a2d4929cd532be0d232d18ee014c71e002f6e7e86f99a315a772bc" }, "downloads": -1, "filename": "leetcode-cli-0.0.2.tar.gz", "has_sig": false, "md5_digest": "48e14b17b8c3f5b9f8d4c5680fd05b3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11927, "upload_time": "2018-09-11T05:44:44", "url": "https://files.pythonhosted.org/packages/e7/d3/ace4555a354c0dd038dc063df02cae22e40fbdd4ed0f6dcd579409586200/leetcode-cli-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2fd6ca8a4369ef97ebefefa4e81b8b58", "sha256": "56a19a3b0b451cfadadb5680768029062fce41f593ccf9e60ed54e78cbb05918" }, "downloads": -1, "filename": "leetcode_cli-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2fd6ca8a4369ef97ebefefa4e81b8b58", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12735, "upload_time": "2019-03-27T07:01:37", "url": "https://files.pythonhosted.org/packages/de/d8/6cfdf8da04280b5dec99f04c139031cc4761adaca9a906ae5623d4aea831/leetcode_cli-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d69fbe6fd2572189013d969552deb6cb", "sha256": "0bad900067ea8c1f941a72aff89fa9c60b68f64dbf64fd500605c64821166955" }, "downloads": -1, "filename": "leetcode-cli-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d69fbe6fd2572189013d969552deb6cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12689, "upload_time": "2019-03-27T07:01:38", "url": "https://files.pythonhosted.org/packages/bf/24/157499b52bb197fc6f7f64a58693aea4cfa24a0cc61540607591030f2d5a/leetcode-cli-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "166c8a82beb7d44333b9acf8616b7f7c", "sha256": "701424ee7f3b3d845eb3c6deb4447ff3aafdd45dbdec47eb6df001211216f19d" }, "downloads": -1, "filename": "leetcode_cli-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "166c8a82beb7d44333b9acf8616b7f7c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12725, "upload_time": "2019-03-31T04:28:11", "url": "https://files.pythonhosted.org/packages/8a/fa/c3b0e95c4bf26053c7d8046a9a944aa726b84f67611c06decb736dceb442/leetcode_cli-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6406efd1eb1cdde021db880422b19e42", "sha256": "b95ee3282be748b3e6537842cedc29e02321b2790e8d27ab5e5b84c8f95463cb" }, "downloads": -1, "filename": "leetcode-cli-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6406efd1eb1cdde021db880422b19e42", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12670, "upload_time": "2019-03-31T04:28:12", "url": "https://files.pythonhosted.org/packages/a3/a5/5ba494a7901e2e8b6873807778efadef7687049f63810752592e3367125f/leetcode-cli-0.0.4.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "5a0d0902ec029598d8a9f0d2934a885f", "sha256": "6ed74a84fa8c72e53e39870c2e9ebb8f75e086d2801ed8d60808d25c008d5d23" }, "downloads": -1, "filename": "leetcode_cli-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a0d0902ec029598d8a9f0d2934a885f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12717, "upload_time": "2019-05-07T01:04:21", "url": "https://files.pythonhosted.org/packages/c0/88/d55684d4469a1b4f4a0bc5fa2845234cc4c871e5ad8590bf92f21c9740b5/leetcode_cli-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c022deec71ebdf25d2c0b2d7519bed15", "sha256": "853762fbe06d05e2098efd8cc134b372631e0b6fbf87b703d084e1906a5dc6d0" }, "downloads": -1, "filename": "leetcode-cli-0.0.6.tar.gz", "has_sig": false, "md5_digest": "c022deec71ebdf25d2c0b2d7519bed15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12634, "upload_time": "2019-05-07T01:04:23", "url": "https://files.pythonhosted.org/packages/42/98/b34102956bd19bc78f09c71ec555067c25f3ed5e6d9d7792950b5df8da2f/leetcode-cli-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a0d0902ec029598d8a9f0d2934a885f", "sha256": "6ed74a84fa8c72e53e39870c2e9ebb8f75e086d2801ed8d60808d25c008d5d23" }, "downloads": -1, "filename": "leetcode_cli-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a0d0902ec029598d8a9f0d2934a885f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12717, "upload_time": "2019-05-07T01:04:21", "url": "https://files.pythonhosted.org/packages/c0/88/d55684d4469a1b4f4a0bc5fa2845234cc4c871e5ad8590bf92f21c9740b5/leetcode_cli-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c022deec71ebdf25d2c0b2d7519bed15", "sha256": "853762fbe06d05e2098efd8cc134b372631e0b6fbf87b703d084e1906a5dc6d0" }, "downloads": -1, "filename": "leetcode-cli-0.0.6.tar.gz", "has_sig": false, "md5_digest": "c022deec71ebdf25d2c0b2d7519bed15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12634, "upload_time": "2019-05-07T01:04:23", "url": "https://files.pythonhosted.org/packages/42/98/b34102956bd19bc78f09c71ec555067c25f3ed5e6d9d7792950b5df8da2f/leetcode-cli-0.0.6.tar.gz" } ] }