{"id":34095579,"url":"https://github.com/blockchainian/cli","last_synced_at":"2026-03-08T23:35:12.081Z","repository":{"id":62575495,"uuid":"106475932","full_name":"blockchainian/cli","owner":"blockchainian","description":"LeetCode CLI","archived":false,"fork":false,"pushed_at":"2023-04-10T08:24:28.000Z","size":99,"stargazers_count":95,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-16T19:06:50.697Z","etag":null,"topics":["leetcode","leetcode-solutions"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blockchainian.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-10T21:58:13.000Z","updated_at":"2025-07-31T17:24:14.000Z","dependencies_parsed_at":"2023-07-19T03:05:13.239Z","dependency_job_id":null,"html_url":"https://github.com/blockchainian/cli","commit_stats":null,"previous_names":["chenpengcheng/cli"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/blockchainian/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainian%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainian%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainian%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainian%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blockchainian","download_url":"https://codeload.github.com/blockchainian/cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blockchainian%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30277056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["leetcode","leetcode-solutions"],"created_at":"2025-12-14T15:15:22.542Z","updated_at":"2026-03-08T23:35:12.071Z","avatar_url":"https://github.com/blockchainian.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\n (\\_/)\n=(^.^)=\n(\")_(\")\n243 solved 17 failed 523 todo\n\n#:/\u003e ?\ncat                     - Show test case(s).\ncd      \u003ctag|number\u003e    - Change problem(s).\ncheat   \u003cnumber\u003e        - Find the best solution.\ncheck                   - Test the solution.\nchmod   \u003clanguage\u003e      - Change programming language.\nclear                   - Clear screen.\nfind    \u003ckeyword\u003e       - Find problems by keyword. Alias: /\u003ckeyword\u003e.\nlimit   \u003cnumber\u003e        - 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 solved problems.\npush                    - Submit the solution.\nsu      \u003csession\u003e       - 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 \u003cTAB\u003e.\n\n#:/\u003e\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#:/\u003e ls\n     29 #\n     81 array\n     28 backtracking            \u003c- 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 \u003ctopic\u003e` changes the current topic.\n\n```\n#:/\u003e cd heap\n#:/heap\u003e\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\u003e ls\n     355 design-twitter                             \u003c- 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               \u003c- 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    \u003c- easy level\n     347 top-k-frequent-elements\n     451 sort-characters-by-frequency\n    *761 employee-free-time                         \u003c- the easiest\n11 solved 0 failed 17 todo\n```\n\n`cd \u003cnumber\u003e` changes the current problem. Then `ls` shows the description.\n\n```\n#:/heap\u003e cd 23\n#:/heap/23-merge-k-sorted-lists\u003e 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-\u003e4-\u003e5,\n 1-\u003e3-\u003e4,\n 2-\u003e6\n]\nOutput: 1-\u003e1-\u003e2-\u003e3-\u003e4-\u003e4-\u003e5-\u003e6\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/\u003cnumber\u003e.\u003cext\u003e` and can be edited.\n\n```\n#:/heap/23-merge-k-sorted-lists\u003e 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\u003e cat\nws/23.py \u003c\u003c [[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 \u003clanguage\u003e`. 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\u003e 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\u003e 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`/\u003ckeyword\u003e` searches for problems matching a tag (`airbnb`) or a keyword (e.g. `palindrome`)\n\n```\n#:/heap/23-merge-k-sorted-lists\u003e cd ..\n#:/heap\u003e cd ..\n#:/\u003e /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#:/\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchainian%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockchainian%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockchainian%2Fcli/lists"}