├── test ├── __init__.py ├── helpers │ ├── __init__.py │ └── test_leetcode.py └── test_dummy.py ├── leetcode_anki ├── __init__.py └── helpers │ ├── __init__.py │ └── leetcode.py ├── test-requirements.txt ├── requirements.txt ├── .gitignore ├── Grind75Full.apkg ├── .pyre_configuration ├── .isort.cfg ├── pyproject.toml ├── Makefile ├── .github └── workflows │ ├── tests.yml │ ├── type-check.yml │ ├── style-check.yml │ └── build-deck.yml ├── LICENSE ├── .travis.yml ├── faang_leetcode_tag_stats.csv ├── global_leetcode_tag_stats.csv ├── README.md ├── get_tag_stats.py ├── generate.py └── faang_leetcode_slug_stats.csv /test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /leetcode_anki/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/helpers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /leetcode_anki/helpers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-asyncio 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | python-leetcode==1.2.1 2 | setuptools==57.5.0 3 | genanki 4 | tqdm 5 | pandas 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cache 2 | leetcode.apkg 3 | .mypy_cache 4 | .cookies.sh 5 | __pycache__ 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /Grind75Full.apkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexbowe/leetcode-anki-with-grind75/HEAD/Grind75Full.apkg -------------------------------------------------------------------------------- /.pyre_configuration: -------------------------------------------------------------------------------- 1 | { 2 | "source_directories": [ 3 | "." 4 | ], 5 | "site_package_search_strategy": "all", 6 | "strict": true 7 | } 8 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | force_grid_wrap=0 3 | include_trailing_comma=True 4 | line_length=88 5 | multi_line_output=3 6 | use_parentheses=True 7 | ensure_newline_before_comments=True 8 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.pytest.ini_options] 2 | asyncio_mode = "strict" 3 | testpaths = [ 4 | "test", 5 | ] 6 | 7 | [tool.pylint] 8 | max-line-length = 88 9 | disable = ["line-too-long"] 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | generate: 2 | # You have to set the variables below in order to 3 | # authenticate on leetcode. It is required to read 4 | # the information about the problems 5 | test ! "x${VIRTUAL_ENV}" = "x" || (echo "Need to run inside venv" && exit 1) 6 | pip install -r requirements.txt 7 | python3 generate.py 8 | -------------------------------------------------------------------------------- /test/test_dummy.py: -------------------------------------------------------------------------------- 1 | """ 2 | Just a placeholder 3 | """ 4 | 5 | 6 | class TestDummy: 7 | """ 8 | Dummy test 9 | """ 10 | 11 | @staticmethod 12 | def test_do_nothing() -> None: 13 | """Do nothing""" 14 | assert True 15 | 16 | @staticmethod 17 | def test_do_nothing2() -> None: 18 | """Do nothing""" 19 | assert True 20 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Tests 3 | on: [push, pull_request] 4 | jobs: 5 | pytest: 6 | name: pytest 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@master 10 | - name: Set up Python 3.9 11 | uses: actions/setup-python@v1 12 | with: 13 | python-version: 3.9 14 | - name: Install requirements 15 | run: pip install -r requirements.txt 16 | - name: Install test requirements 17 | run: pip install -r test-requirements.txt 18 | - name: Install pytest 19 | run: pip install pytest 20 | - name: Run pytest 21 | run: pytest 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/type-check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Typing 3 | on: [push, pull_request] 4 | jobs: 5 | mypy: 6 | name: mypy 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@master 10 | - name: Set up Python 3.9 11 | uses: actions/setup-python@v1 12 | with: 13 | python-version: 3.9 14 | - name: Install requirements 15 | run: pip install -r requirements.txt 16 | - name: Install test requirements 17 | run: pip install -r test-requirements.txt 18 | - name: Install mypy 19 | run: pip install mypy 20 | - name: Run mypy 21 | run: mypy . 22 | pyre: 23 | name: pyre 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@master 27 | - name: Set up Python 3.9 28 | uses: actions/setup-python@v1 29 | with: 30 | python-version: 3.9 31 | - name: Install requirements 32 | run: pip install -r requirements.txt 33 | - name: Install test requirements 34 | run: pip install -r test-requirements.txt 35 | - name: Install pyre 36 | run: pip install pyre-check 37 | - name: Run pyre 38 | run: pyre check 39 | -------------------------------------------------------------------------------- /.github/workflows/style-check.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Style 3 | on: [push, pull_request] 4 | jobs: 5 | pylint: 6 | name: pylint 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@master 10 | - name: Set up Python 3.9 11 | uses: actions/setup-python@v1 12 | with: 13 | python-version: 3.9 14 | - name: Install requirements 15 | run: pip install -r requirements.txt 16 | - name: Install test requirements 17 | run: pip install -r test-requirements.txt 18 | - name: Install pylint 19 | run: pip install pylint 20 | - name: Run pylint 21 | run: find . -type f -name "*.py" | xargs pylint -E 22 | black: 23 | name: black 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@master 27 | - name: Set up Python 3.9 28 | uses: actions/setup-python@v1 29 | with: 30 | python-version: 3.9 31 | - name: Install requirements 32 | run: pip install -r requirements.txt 33 | - name: Install black 34 | run: pip install black 35 | - name: Run black 36 | run: black --check --diff . 37 | isort: 38 | name: isort 39 | runs-on: ubuntu-latest 40 | steps: 41 | - uses: actions/checkout@master 42 | - name: Set up Python 3.9 43 | uses: actions/setup-python@v1 44 | with: 45 | python-version: 3.9 46 | - name: Install requirements 47 | run: pip install -r requirements.txt 48 | - name: Install isort 49 | run: pip install isort 50 | - name: Run isort 51 | run: isort --ensure-newline-before-comments --diff -v . 52 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - '3.9' 4 | install: 5 | - pip install -r requirements.txt 6 | - pip install awscli 7 | script: 8 | jobs: 9 | include: 10 | # Each step caches fetched problems from the previous one 11 | # so the next one runs faster. 12 | # This is a hack because travis CI has a time limit of 30 13 | # minutes for each individual job 14 | - stage: 0 to 2 (test run) 15 | script: 16 | - python generate.py --start 0 --stop 2 17 | - aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 18 | - stage: 2 to 500 19 | script: 20 | - aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache 21 | - python generate.py --start 0 --stop 500 22 | - aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 23 | - stage: 500 to 1000 24 | script: 25 | - aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache 26 | - python generate.py --start 0 --stop 1000 27 | - aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 28 | - stage: 1000 to 1500 29 | script: 30 | - aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache 31 | - python generate.py --start 0 --stop 1500 32 | - aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 33 | - stage: 1500 to 2000 34 | script: 35 | - aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache 36 | - python generate.py --start 0 --stop 2000 37 | - aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 38 | - stage: 2000 to 2500 39 | script: 40 | - aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache 41 | - python generate.py --start 0 --stop 2500 42 | - aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 43 | - stage: 2500 to 3000 44 | script: 45 | - aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache 46 | - python generate.py --start 0 --stop 3000 47 | - aws s3 rm --recursive s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 48 | deploy: 49 | provider: releases 50 | api_key: $GITHUB_TOKEN 51 | file: leetcode.apkg 52 | skip_cleanup: true 53 | on: 54 | branch: master 55 | after_failure: 56 | - aws s3 rm --recursive s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER 57 | -------------------------------------------------------------------------------- /.github/workflows/build-deck.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Build Anki deck 3 | on: [push, pull_request] 4 | jobs: 5 | build-anki-deck: 6 | name: Build Anki deck 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@master 10 | - name: Set up Python 3.9 11 | uses: actions/setup-python@v1 12 | with: 13 | python-version: 3.9 14 | - name: Install requirements 15 | run: pip install -r requirements.txt 16 | - name: Install sqlite 17 | run: sudo apt-get install sqlite3 unzip 18 | - name: Get current date 19 | id: date 20 | run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H:%M:%S')" 21 | - name: Get current timestamp 22 | id: timestamp 23 | run: echo "::set-output name=timestamp::$(date +'%s')" 24 | - name: Test build Anki Deck 25 | run: > 26 | git clean -f -x -d 27 | && python generate.py --start 1 --stop 5 --page-size 2 28 | && unzip leetcode.apkg 29 | && sqlite3 collection.anki2 .schema 30 | && sqlite3 collection.anki2 .dump 31 | env: 32 | LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }} 33 | - name: Test build Anki Deck (non-default output file) 34 | run: > 35 | git clean -f -x -d 36 | && python generate.py --stop 3 --output-file test.apkg 37 | && unzip test.apkg 38 | && sqlite3 collection.anki2 .schema 39 | && sqlite3 collection.anki2 .dump 40 | env: 41 | LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }} 42 | - name: Test build Anki Deck with Amazon list id 43 | run: python generate.py --stop 10 --list-id 7p5x763 44 | env: 45 | LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }} 46 | - name: Build Anki Deck 47 | run: python generate.py 48 | if: github.ref == 'refs/heads/master' 49 | env: 50 | LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }} 51 | - name: Create Release 52 | id: create_release 53 | uses: actions/create-release@v1 54 | env: 55 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 56 | with: 57 | tag_name: ${{ github.ref }}-${{ steps.timestamp.outputs.timestamp }} 58 | release_name: > 59 | Anki Deck from ${{ github.ref }} on ${{ steps.date.outputs.date }} 60 | draft: true 61 | prerelease: true 62 | - name: Upload release asset 63 | uses: actions/upload-release-asset@v1 64 | env: 65 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 66 | with: 67 | upload_url: ${{ steps.create_release.outputs.upload_url }} 68 | asset_path: ./leetcode.apkg 69 | asset_name: leetcode.apkg 70 | asset_content_type: application/octet-stream 71 | - name: Publish release 72 | uses: StuYarrow/publish-release@v1 73 | env: 74 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 75 | with: 76 | id: ${{ steps.create_release.outputs.id }} 77 | -------------------------------------------------------------------------------- /faang_leetcode_tag_stats.csv: -------------------------------------------------------------------------------- 1 | tag,times_encountered,freq,cumsum,cumfreq 2 | array,5305,0.16592124605135583,5305,0.16592124605135583 3 | string,2357,0.07371844994213868,7662,0.23963969599349452 4 | hash-table,1973,0.06170831639195571,9635,0.3013480123854502 5 | dynamic-programming,1726,0.05398304819691615,11361,0.35533106058236635 6 | depth-first-search,1676,0.05241922872423607,13037,0.40775028930660245 7 | breadth-first-search,1376,0.04303631188815563,14413,0.45078660119475805 8 | sorting,1239,0.038751446533012227,15652,0.4895380477277703 9 | math,1227,0.03837612985956901,16879,0.5279141775873393 10 | tree,1115,0.03487317424076564,17994,0.5627873518281049 11 | binary-tree,1032,0.03227723391611673,19026,0.5950645857442217 12 | two-pointers,969,0.03030682138053983,19995,0.6253714071247615 13 | binary-search,933,0.029180871360210178,20928,0.6545522784849717 14 | matrix,850,0.026584931035561254,21778,0.6811372095205329 15 | stack,785,0.02455196572107716,22563,0.7056891752416101 16 | greedy,750,0.023457292090201108,23313,0.7291464673318112 17 | heap-priority-queue,721,0.022550276796046664,24034,0.7516967441278579 18 | prefix-sum,611,0.019109873956150502,24645,0.7708066180840084 19 | design,599,0.018734557282707284,25244,0.7895411753667156 20 | graph,508,0.01588840584242955,25752,0.8054295812091452 21 | union-find,470,0.014699903043192694,26222,0.8201294842523379 22 | linked-list,455,0.014230757201388671,26677,0.8343602414537266 23 | monotonic-stack,401,0.012541832170894192,27078,0.8469020736246208 24 | divide-and-conquer,395,0.012354173834172583,27473,0.8592562474587934 25 | recursion,339,0.0106026960247709,27812,0.8698589434835643 26 | backtracking,338,0.010571419635317299,28150,0.8804303631188816 27 | sliding-window,319,0.009977168235698872,28469,0.8904075313545804 28 | bit-manipulation,278,0.00869483626810121,28747,0.8991023676226816 29 | counting,251,0.007850373752853971,28998,0.9069527413755356 30 | simulation,238,0.007443780689957151,29236,0.9143965220654927 31 | binary-search-tree,216,0.006755700121977919,29452,0.9211522221874707 32 | trie,204,0.0063803834485347015,29656,0.9275326056360054 33 | ordered-set,202,0.006317830669627498,29858,0.9338504363056329 34 | topological-sort,176,0.005504644543833859,30034,0.9393550808494667 35 | queue,159,0.004972945923122635,30193,0.9443280267725894 36 | segment-tree,145,0.0045350764707722145,30338,0.9488631032433615 37 | database,142,0.00444124730241141,30480,0.953304350545773 38 | geometry,125,0.003909548681700185,30605,0.9572138992274731 39 | merge-sort,97,0.003033809776999343,30702,0.9602477090044725 40 | interactive,96,0.0030025333875457415,30798,0.9632502423920183 41 | data-stream,94,0.002939980608638539,30892,0.9661902230006568 42 | randomized,93,0.0029087042191849374,30985,0.9690989272198417 43 | quickselect,85,0.0026584931035561255,31070,0.9717574203233978 44 | shortest-path,84,0.002627216714102524,31154,0.9743846370375004 45 | combinatorics,76,0.002377005598473712,31230,0.9767616426359741 46 | binary-indexed-tree,74,0.002314452819566509,31304,0.9790760954555406 47 | monotonic-queue,67,0.002095518093391299,31371,0.9811716135489319 48 | memoization,65,0.0020329653144840957,31436,0.9832045788634161 49 | bitmask,65,0.0020329653144840957,31501,0.9852375441779001 50 | iterator,50,0.0015638194726800738,31551,0.9868013636505801 51 | hash-function,50,0.0015638194726800738,31601,0.9883651831232603 52 | string-matching,49,0.0015325430832264723,31650,0.9898977262064867 53 | minimum-spanning-tree,36,0.0011259500203296532,31686,0.9910236762268164 54 | bucket-sort,35,0.0010946736308760517,31721,0.9921183498576924 55 | enumeration,34,0.0010633972414224502,31755,0.9931817470991149 56 | game-theory,33,0.0010321208519688486,31788,0.9942138679510837 57 | doubly-linked-list,26,0.0008131861257936383,31814,0.9950270540768774 58 | counting-sort,25,0.0007819097363400369,31839,0.9958089638132174 59 | rolling-hash,18,0.0005629750101648266,31857,0.9963719388233823 60 | eulerian-circuit,18,0.0005629750101648266,31875,0.996934913833547 61 | number-theory,18,0.0005629750101648266,31893,0.9974978888437119 62 | line-sweep,13,0.00040659306289681917,31906,0.9979044819066087 63 | shell,12,0.0003753166734432177,31918,0.9982797985800519 64 | suffix-array,12,0.0003753166734432177,31930,0.9986551152534952 65 | brainteaser,11,0.0003440402839896162,31941,0.9989991555374848 66 | probability-and-statistics,7,0.00021893472617521032,31948,0.9992180902636599 67 | radix-sort,6,0.00018765833672160885,31954,0.9994057486003816 68 | concurrency,6,0.00018765833672160885,31960,0.9995934069371032 69 | biconnected-component,6,0.00018765833672160885,31966,0.9997810652738248 70 | strongly-connected-component,4,0.00012510555781440592,31970,0.9999061708316392 71 | reservoir-sampling,3,9.382916836080442e-05,31973,1.0 72 | -------------------------------------------------------------------------------- /global_leetcode_tag_stats.csv: -------------------------------------------------------------------------------- 1 | tag,times_encountered,freq,cumsum,cumfreq 2 | array,11074,0.1687440953280712,11074,0.1687440953280712 3 | string,5247,0.07995306738183038,16321,0.24869716270990155 4 | hash-table,4597,0.07004845640447384,20918,0.3187456191143754 5 | dynamic-programming,3503,0.053378234236430684,24421,0.37212385335080606 6 | depth-first-search,3000,0.04571358912626093,27421,0.417837442477067 7 | math,2718,0.04141651174839241,30139,0.45925395422545945 8 | sorting,2631,0.040090817663730835,32770,0.49934477188919024 9 | breadth-first-search,2529,0.03853655563343797,35299,0.5378813275226282 10 | two-pointers,2171,0.033081400664370826,37470,0.570962728186999 11 | tree,1874,0.028555755340870997,39344,0.5995184835278701 12 | binary-search,1820,0.0277329107365983,41164,0.6272513942644683 13 | matrix,1816,0.02767195928442995,42980,0.6549233535488983 14 | binary-tree,1707,0.02601103221284247,44687,0.6809343857617408 15 | stack,1611,0.02454819736080212,46298,0.7054825831225429 16 | greedy,1557,0.023725352756529424,47855,0.7292079358790723 17 | design,1384,0.021089202450248378,49239,0.7502971383293207 18 | heap-priority-queue,1272,0.019382561789534635,50511,0.7696797001188553 19 | linked-list,1168,0.01779782403315759,51679,0.7874775241520129 20 | backtracking,919,0.014003596135677933,52598,0.8014811202876908 21 | prefix-sum,915,0.013942644683509585,53513,0.8154237649712004 22 | graph,906,0.013805503916130802,54419,0.8292292688873313 23 | union-find,865,0.013180751531405235,55284,0.8424100204187365 24 | recursion,834,0.01270837777710054,56118,0.855118398195837 25 | divide-and-conquer,798,0.012159814707585408,56916,0.8672782129034224 26 | sliding-window,767,0.011687440953280712,57683,0.8789656538567031 27 | counting,685,0.01043793618382958,58368,0.8894035900405327 28 | bit-manipulation,675,0.01028555755340871,59043,0.8996891475939415 29 | monotonic-stack,584,0.008898912016578796,59627,0.9085880596105202 30 | simulation,549,0.008365586810105751,60176,0.9169536464206259 31 | trie,436,0.006643708286349922,60612,0.9235973547069759 32 | queue,426,0.006491329655929053,61038,0.9300886843629049 33 | binary-search-tree,410,0.006247523847255661,61448,0.9363362082101606 34 | ordered-set,325,0.004952305488678268,61773,0.9412885136988389 35 | topological-sort,297,0.004525645323499832,62070,0.9458141590223387 36 | randomized,247,0.0037637521713954833,62317,0.9495779111937341 37 | database,232,0.003535184225764179,62549,0.9531130954194984 38 | data-stream,225,0.00342851918446957,62774,0.9565416146039679 39 | memoization,215,0.0032761405540487,62989,0.9598177551580166 40 | segment-tree,197,0.0030018590192911346,63186,0.9628196141773078 41 | geometry,189,0.0028799561149544387,63375,0.9656995702922622 42 | doubly-linked-list,187,0.0028494803888702647,63562,0.9685490506811325 43 | interactive,184,0.0028037667997440037,63746,0.9713528174808764 44 | merge-sort,164,0.0024990095389022643,63910,0.9738518270197788 45 | quickselect,145,0.002209490141102612,64055,0.9760613171608814 46 | bitmask,135,0.002057111510681742,64190,0.9781184286715631 47 | shortest-path,130,0.001980922195471307,64320,0.9800993508670344 48 | monotonic-queue,129,0.00196568433242922,64449,0.9820650351994636 49 | bucket-sort,126,0.0019199707433029591,64575,0.9839850059427666 50 | binary-indexed-tree,111,0.0016914027976716545,64686,0.9856764087404383 51 | combinatorics,110,0.0016761649346295675,64796,0.9873525736750678 52 | hash-function,106,0.0016152134824612197,64902,0.988967787157529 53 | enumeration,101,0.0015390241672507848,65003,0.9905068113247798 54 | iterator,91,0.0013866455368299149,65094,0.9918934568616097 55 | string-matching,85,0.0012952183585773931,65179,0.9931886752201872 56 | game-theory,58,0.0008837960564410447,65237,0.9940724712766281 57 | counting-sort,49,0.0007466552890622619,65286,0.9948191265656904 58 | concurrency,43,0.0006552281108097401,65329,0.9954743546765001 59 | rolling-hash,40,0.0006095145216834791,65369,0.9960838691981836 60 | minimum-spanning-tree,40,0.0006095145216834791,65409,0.9966933837198672 61 | number-theory,32,0.0004876116173467833,65441,0.9971809953372139 62 | line-sweep,26,0.00039618443909426144,65467,0.9975771797763082 63 | eulerian-circuit,25,0.00038094657605217445,65492,0.9979581263523604 64 | brainteaser,24,0.00036570871301008746,65516,0.9983238350653705 65 | radix-sort,24,0.00036570871301008746,65540,0.9986895437783805 66 | shell,19,0.00028951939779965256,65559,0.9989790631761801 67 | suffix-array,19,0.00028951939779965256,65578,0.9992685825739799 68 | probability-and-statistics,18,0.0002742815347575656,65596,0.9995428641087374 69 | biconnected-component,12,0.00018285435650504373,65608,0.9997257184652424 70 | rejection-sampling,9,0.0001371407673787828,65617,0.9998628592326212 71 | reservoir-sampling,5,7.618931521043489e-05,65622,0.9999390485478317 72 | strongly-connected-component,4,6.095145216834791e-05,65626,1.0 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![build](https://github.com/prius/leetcode-anki/actions/workflows/build-deck.yml/badge.svg) 3 | ![style](https://github.com/prius/leetcode-anki/actions/workflows/style-check.yml/badge.svg) 4 | ![tests](https://github.com/prius/leetcode-anki/actions/workflows/tests.yml/badge.svg) 5 | ![types](https://github.com/prius/leetcode-anki/actions/workflows/type-check.yml/badge.svg) 6 | ![license](https://img.shields.io/github/license/prius/leetcode-anki) 7 | 8 | # Leetcode Anki card generator 9 | 10 | ## Alex Bowe's Update 11 | 12 | I have modified Prius's code in the following ways: 13 | 14 | - Added a tag for all [Grind 75](https://www.techinterviewhandbook.org/grind75) problems. 15 | - [The order of these questions is important](https://www.techinterviewhandbook.org/grind75/faq) and Anki is 16 | uncooperative when it comes to changing new card order, so I add them in the order that they appear in the list. 17 | - Added an option (in code only) to omit LeetCode problems that aren't on the Grind 75 list. 18 | - Added an option (in code only) to omit premium questions (useful if you are building the deck for 19 | someone else). 20 | - Added an option to disable outputting the problem statement. This is useful if you want to share the deck without getting sued. 21 | - Added company tags. 22 | - Arranged all tags hierarchically (for use with [this add-on](https://ankiweb.net/shared/info/594329229)). 23 | - Added paid/free tags (these are card properties but tags can be nicer to work with). 24 | - Tagged `grind75::base` and `grind75::extended`. 25 | - Suspend all cards outside of `grind75::base` by default. 26 | - Updated notes to have company stats for aggregation. 27 | - Added script `get_tag_stats.py` to output CSVs of frequency for each topic (e.g. `arrays`). 28 | 29 | A pre-compiled deck with all 169 Grind 75 problems (including premium problems) and no problem description 30 | (for the sake of legality) is available [here](Grind75.apkg). 31 | 32 | Ideally this could be merged back into the original repository. These changes should be made: 33 | 34 | - Add command-line flags for the new options above. 35 | - Add support for multiple subsets, where the user can specify a list of text files defining these subsets. 36 | This could just be a list of question slugs on each line, with the filename providing the name of the subset 37 | (which would determine the resulting tag). 38 | - Move the Grind 75 fetching code to a separate script, and update the `Makefile` to use it to generate a `grind75.txt` 39 | file which can be used as a command-line argument. 40 | - Add a command-line flag to suspend cards outside of a user specified union of subsets (suspension can be nicer than omission). 41 | 42 | ## Summary 43 | 44 | By running this script you'll be able to generate Anki cards with all the leetcode problems. 45 | 46 | I personally use it to track my grinding progress. 47 | 48 | ![ezgif-7-03b29041a91e](https://user-images.githubusercontent.com/1616237/134259809-57af6afb-8885-4899-adf8-a2639977baeb.gif) 49 | 50 | ![photo_2021-09-29_08-58-19 jpg 2](https://user-images.githubusercontent.com/1616237/135676120-6a83229d-9715-45fb-8f85-1b1b27d96f9b.png) 51 | ![photo_2021-09-29_08-58-21 jpg 2](https://user-images.githubusercontent.com/1616237/135676123-106871e0-bc8e-4d23-acef-c27ebe034ecf.png) 52 | ![photo_2021-09-29_08-58-23 jpg 2](https://user-images.githubusercontent.com/1616237/135676125-90067ea3-e111-49da-ae13-7bce81040c37.png) 53 | 54 | ## Prerequisites 55 | 1. [python3.8+](https://www.python.org/downloads/) installed 56 | 2. [python virtualenv](https://pypi.org/project/virtualenv/) installed 57 | 3. [git cli](https://github.com/git-guides/install-git) installed 58 | 4. [GNU make](https://www.gnu.org/software/make/) installed (optional, can run the script directly) 59 | 5. \*nix operating system (Linux, MacOS, FreeBSD, ...). Should also work for Windows, but commands will be different. I'm not a Windows expert, so can't figure out how to make it work there, but contributions are welcome. 60 | 61 | ## How to run 62 | First download the source code 63 | ``` 64 | git clone https://github.com/prius/leetcode-anki.git 65 | cd leetcode-anki 66 | ``` 67 | 68 | After that initialize and activate python virtualenv somewhere 69 | 70 | Linux/MacOS 71 | ``` 72 | virtualenv -p python leetcode-anki 73 | . leetcode-anki/bin/activate 74 | ``` 75 | 76 | Windows 77 | ``` 78 | python -m venv leetcode-anki 79 | .\leetcode-anki\Scripts\activate.bat 80 | ``` 81 | 82 | Then initialize session id variable. You can get it directly from your browser (if you're using chrome, cookies can be found using this method: https://developer.chrome.com/docs/devtools/storage/cookies/) 83 | 84 | Linux/Macos 85 | ``` 86 | export LEETCODE_SESSION_ID="yyy" 87 | ``` 88 | 89 | Windows 90 | ``` 91 | set LEETCODE_SESSION_ID="yyy" 92 | ``` 93 | 94 | And finally run for Linux/MacOS 95 | ``` 96 | make generate 97 | ``` 98 | Or for Windows 99 | ``` 100 | pip install -r requirements.txt 101 | python generate.py 102 | ``` 103 | 104 | You'll get `leetcode.apkg` file, which you can import directly to your anki app. 105 | -------------------------------------------------------------------------------- /get_tag_stats.py: -------------------------------------------------------------------------------- 1 | """ 2 | Break down LeetCode problems by topic and gather stats on frequency of each topic. 3 | 4 | Like https://algo.monster/problems/stats, but they seem to ignore how often each 5 | question is asked (or their data is outdated). Also, they don't follow guidelines 6 | for how to render a pie chart. 7 | 8 | For information on how to render a pie chart "correctly", see: 9 | The Wall Street Journal Guide to Information Graphics: The Dos and Don'ts of 10 | Presenting Data, Facts, and Figures Paperback – Illustrated, December 16, 2013 11 | by Dona M. Wong (Author) 12 | (Note: Dona Wong was a PhD student of Edward Tufte) 13 | 14 | A nice place to generate pie charts: https://chart-studio.plotly.com/ 15 | """ 16 | 17 | import yaml 18 | import pandas as pd 19 | 20 | # Exported to CSV from Anki deck from https://github.com/alexbowe/leetcode-anki-with-grind75 21 | # using https://ankiweb.net/shared/info/1478130872 22 | # Could also load an Anki deck in SQLite instead - 23 | # See https://github.com/ankidroid/Anki-Android/wiki/Database-Structure 24 | CSV_PATH = "Selected Notes.csv" 25 | TOPIC_TAG_PREFIX = "LeetCode::topic::" 26 | GRIND_75_BASE_TAG = "LeetCode::subset::grind75::base" 27 | FAANG_COMPANIES = {"facebook", "amazon", "airbnb", "netflix", "google"} 28 | 29 | def get_company_stats_dict(x): 30 | if not isinstance(x, str): 31 | return [] 32 | #if x == "nan": 33 | # return [] 34 | stats = eval(x) 35 | if not stats: 36 | return [] 37 | # Yaml is used because it is a superset of JSON, 38 | # and this is a hack to get around the way CSV strings 39 | # are formatted. 40 | dicts = yaml.load(stats, Loader=yaml.SafeLoader) 41 | company_stats = [{"company":d["slug"], "times_encountered": d["timesEncountered"]} 42 | for d in dicts if d["timesEncountered"] > 0] 43 | return company_stats 44 | 45 | def get_sorted_tag_total_times_encountered(df): 46 | # Get total times encountered 47 | new_df = df.groupby("tag").times_encountered.sum() 48 | 49 | # Groupby removes the index, so we need to remove it to sort it 50 | new_df = new_df.reset_index() 51 | 52 | new_df = new_df.sort_values(["times_encountered"],ascending=False) 53 | new_df["freq"] = new_df.times_encountered / new_df.times_encountered.sum() 54 | new_df["cumsum"] = new_df.times_encountered.cumsum() 55 | new_df["cumfreq"] = new_df["cumsum"] / new_df.times_encountered.sum() 56 | return new_df 57 | 58 | def get_sorted_slug_total_times_encountered(df): 59 | # Get total times encountered 60 | new_df = df.groupby(["slug", "grind75"]).times_encountered.sum() 61 | 62 | # Groupby removes the index, so we need to remove it to sort it 63 | new_df = new_df.reset_index() 64 | 65 | new_df = new_df.sort_values(["times_encountered"],ascending=False) 66 | new_df["freq"] = new_df.times_encountered / new_df.times_encountered.sum() 67 | new_df["cumsum"] = new_df.times_encountered.cumsum() 68 | new_df["cumfreq"] = new_df["cumsum"] / new_df.times_encountered.sum() 69 | return new_df 70 | 71 | CSV_COLUMNS = [ 72 | "slug", 73 | "id", 74 | "title", 75 | "topic", 76 | "content", 77 | "difficulty", 78 | "paid", 79 | "likes", 80 | "dislikes", 81 | "submissions_total", 82 | "submissions_accepted", 83 | "submission_accept_rate", 84 | "frequency", 85 | "total_times_encountered", 86 | "company_stats", 87 | "tags", 88 | ] 89 | 90 | df = pd.read_csv(CSV_PATH, names=CSV_COLUMNS) 91 | 92 | # Add grind75 column 93 | df["grind75"] = df.tags.str.contains(GRIND_75_BASE_TAG) 94 | 95 | # Split tags column 96 | df["tags"] = df.tags.str.split(" ").tolist() 97 | df = df.explode("tags") 98 | 99 | # Filter out non-topic tags 100 | df = df[df.tags.str.startswith(TOPIC_TAG_PREFIX)] 101 | 102 | # Remove tag prefix 103 | df["tag"] = df.tags.str[len(TOPIC_TAG_PREFIX):] 104 | del df["tags"] # We don't need the plural column anymore 105 | 106 | df["company_stats"] = df.company_stats.apply(get_company_stats_dict) 107 | df = df.explode("company_stats") 108 | 109 | # Remove questions that don't have any company stats 110 | df = df[~df.company_stats.isnull()] 111 | 112 | # Split company_stats into company and times_encountered fields 113 | df["company"] = df.company_stats.apply(lambda x: x["company"]) 114 | df["times_encountered"] = df.company_stats.apply(lambda x: x["times_encountered"]) 115 | del df["company_stats"] # We don't need the dict column anymore 116 | 117 | # Get total times encountered for each tag 118 | global_total_times_encountered_df = get_sorted_tag_total_times_encountered(df) 119 | 120 | # Get FAANG companies only 121 | faang_df = df[df.company.isin(FAANG_COMPANIES)] 122 | faang_total_times_encountered_df = get_sorted_tag_total_times_encountered(faang_df) 123 | 124 | # Get slug-based total times encountered 125 | global_slug_total_times_encountered_df = get_sorted_slug_total_times_encountered(df) 126 | 127 | # Get slug-based total times encountered for FAANG 128 | faang_slug_total_times_encountered_df = get_sorted_slug_total_times_encountered(faang_df) 129 | 130 | # Write to CSV without the original row number 131 | df.to_csv("leetcode_stats.csv", index=False) 132 | global_slug_total_times_encountered_df.to_csv("global_leetcode_slug_stats.csv", index=False) 133 | faang_slug_total_times_encountered_df.to_csv("faang_leetcode_slug_stats.csv", index=False) 134 | global_total_times_encountered_df.to_csv("global_leetcode_tag_stats.csv", index=False) 135 | faang_total_times_encountered_df.to_csv("faang_leetcode_tag_stats.csv", index=False) 136 | 137 | -------------------------------------------------------------------------------- /generate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | This script generates an Anki deck with all the leetcode problems currently 4 | known. 5 | """ 6 | 7 | import argparse 8 | import asyncio 9 | from doctest import debug_script 10 | import logging 11 | from pyclbr import Function 12 | import requests 13 | import re 14 | from collections import defaultdict 15 | from pathlib import Path 16 | from typing import Any, Awaitable, Callable, Coroutine, List, Optional, Dict 17 | import json 18 | 19 | # https://github.com/kerrickstaley/genanki 20 | import genanki # type: ignore 21 | from tqdm import tqdm # type: ignore 22 | 23 | import leetcode_anki.helpers.leetcode 24 | 25 | LEETCODE_ANKI_MODEL_ID = 4567610856 26 | LEETCODE_ANKI_DECK_ID = 8589798175 27 | OUTPUT_FILE = "leetcode.apkg" 28 | OUTPUT_JSON = "leetcode.json" 29 | ALLOWED_EXTENSIONS = {".py", ".go"} 30 | GRIND75_URL = "https://www.techinterviewhandbook.org/grind75?mode=all&grouping=none&order=all_rounded" 31 | GRIND75_NAME = "grind75" 32 | 33 | 34 | logging.getLogger().setLevel(logging.INFO) 35 | 36 | 37 | def get_grind75_problem_slugs() -> List[str]: 38 | """ 39 | Get the problem slugs for all problems of the Grind 75 problem collection, in order. 40 | 41 | Note that there are more than 75 problems. 42 | """ 43 | response = requests.get(GRIND75_URL) 44 | response.raise_for_status() 45 | return re.findall(b'https://leetcode.com/problems/(.*?)\"', response.content) 46 | 47 | def get_grind75_lookup_table() -> Dict[str, int]: 48 | """ 49 | Get the reverse lookup table to specify the order of each Grind 75 problem. 50 | """ 51 | return {slug.decode("utf8"):i for i,slug in enumerate(get_grind75_problem_slugs())} 52 | 53 | def parse_args() -> argparse.Namespace: 54 | """ 55 | Parse command line arguments for the script 56 | """ 57 | parser = argparse.ArgumentParser(description="Generate Anki cards for leetcode") 58 | parser.add_argument( 59 | "--start", type=int, help="Start generation from this problem", default=0 60 | ) 61 | parser.add_argument( 62 | "--stop", type=int, help="Stop generation on this problem", default=2**64 63 | ) 64 | parser.add_argument( 65 | "--page-size", 66 | type=int, 67 | help="Get at most this many problems (decrease if leetcode API times out)", 68 | default=500, 69 | ) 70 | parser.add_argument( 71 | "--list-id", 72 | type=str, 73 | help="Get all questions from a specific list id (https://leetcode.com/list?selectedList=", 74 | default="", 75 | ) 76 | parser.add_argument( 77 | "--output-file", type=str, help="Output filename", default=OUTPUT_FILE 78 | ) 79 | 80 | args = parser.parse_args() 81 | 82 | return args 83 | 84 | 85 | class LeetcodeNote(genanki.Note): 86 | """ 87 | Extended base class for the Anki note, that correctly sets the unique 88 | identifier of the note. 89 | """ 90 | 91 | @property 92 | def guid(self) -> str: 93 | # Hash by leetcode task handle 94 | return genanki.guid_for(self.fields[0]) 95 | 96 | 97 | async def generate_anki_note( 98 | leetcode_data: leetcode_anki.helpers.leetcode.LeetcodeData, 99 | leetcode_model: genanki.Model, 100 | leetcode_task_handle: str, 101 | output_description: bool = True, 102 | subsets: Optional[Dict[str, str]] = None, 103 | suspend: Optional[Function] = None, 104 | ) -> LeetcodeNote: 105 | """ 106 | Generate a single Anki flashcard 107 | """ 108 | def get_subsets(slug): 109 | return list(sorted(subsets[slug])) 110 | 111 | def paid_tag(paid): 112 | if paid: 113 | return "LeetCode::access::paid" 114 | return "LeetCode::access::free" 115 | 116 | is_paid = await leetcode_data.paid(leetcode_task_handle) 117 | 118 | suspend = suspend or (lambda x: False) 119 | 120 | note = LeetcodeNote( 121 | model=leetcode_model, 122 | fields=[ 123 | leetcode_task_handle, 124 | str(await leetcode_data.problem_id(leetcode_task_handle)), 125 | str(await leetcode_data.title(leetcode_task_handle)), 126 | str(await leetcode_data.category(leetcode_task_handle)), 127 | await leetcode_data.description(leetcode_task_handle) if output_description else "", 128 | await leetcode_data.difficulty(leetcode_task_handle), 129 | "yes" if is_paid else "no", 130 | str(await leetcode_data.likes(leetcode_task_handle)), 131 | str(await leetcode_data.dislikes(leetcode_task_handle)), 132 | str(await leetcode_data.submissions_total(leetcode_task_handle)), 133 | str(await leetcode_data.submissions_accepted(leetcode_task_handle)), 134 | str( 135 | int( 136 | await leetcode_data.submissions_accepted(leetcode_task_handle) 137 | / await leetcode_data.submissions_total(leetcode_task_handle) 138 | * 100 139 | ) 140 | ), 141 | str(await leetcode_data.freq_bar(leetcode_task_handle)), 142 | str(await leetcode_data.total_times_encountered(leetcode_task_handle)), 143 | json.dumps(await leetcode_data.company_stats(leetcode_task_handle)), 144 | ], 145 | tags=await leetcode_data.tags(leetcode_task_handle) + get_subsets(leetcode_task_handle) + [paid_tag(is_paid)], 146 | # FIXME: sort field doesn't work 147 | sort_field=str(await leetcode_data.freq_bar(leetcode_task_handle)).zfill(3), 148 | ) 149 | if suspend(leetcode_task_handle): 150 | for card in note.cards: 151 | card.suspend = True 152 | return note 153 | 154 | 155 | async def generate( 156 | start: int, stop: int, page_size: int, list_id: str, output_file: str, grind75_only=False, allow_premium=True, output_description=True, 157 | ) -> None: 158 | """ 159 | Generate an Anki deck 160 | """ 161 | description_header = "" if not output_description else "

Description

" 162 | leetcode_model = genanki.Model( 163 | LEETCODE_ANKI_MODEL_ID, 164 | "LeetCode model", 165 | fields=[ 166 | {"name": "Slug"}, 167 | {"name": "Id"}, 168 | {"name": "Title"}, 169 | {"name": "Topic"}, 170 | {"name": "Content"}, 171 | {"name": "Difficulty"}, 172 | {"name": "Paid"}, 173 | {"name": "Likes"}, 174 | {"name": "Dislikes"}, 175 | {"name": "SubmissionsTotal"}, 176 | {"name": "SubmissionsAccepted"}, 177 | {"name": "SumissionAcceptRate"}, 178 | {"name": "Frequency"}, 179 | {"name": "Total Times Encountered"}, # Should correlate to frequency but might not? 180 | {"name": "Company Stats"}, 181 | # TODO: add hints 182 | ], 183 | templates=[ 184 | { 185 | "name": "LeetCode", 186 | "qfmt": f""" 187 |

{{{{Id}}}}. {{{{Title}}}}

188 | Difficulty: {{{{Difficulty}}}}
189 | 👍 {{{{Likes}}}} 👎 {{{{Dislikes}}}}
190 | Submissions (total/accepted): 191 | {{{{SubmissionsTotal}}}}/{{{{SubmissionsAccepted}}}} 192 | ({{{{SumissionAcceptRate}}}}%) 193 |
194 | Topic: {{{{Topic}}}}
195 | Frequency: 196 | 197 | {{{{Frequency}}}}% 198 | 199 |
200 | URL: 201 | 202 | https://leetcode.com/problems/{{{{Slug}}}}/ 203 | 204 |
205 | {description_header} 206 | {{{{Content}}}} 207 | """, 208 | "afmt": """ 209 | {{FrontSide}} 210 |
211 | Discuss URL: 212 | 213 | https://leetcode.com/problems/{{Slug}}/discuss/ 214 | 215 |
216 | Solution URL: 217 | 218 | https://leetcode.com/problems/{{Slug}}/solution/ 219 | 220 |
221 | """, 222 | } 223 | ], 224 | ) 225 | leetcode_deck = genanki.Deck(LEETCODE_ANKI_DECK_ID, Path(output_file).stem) 226 | 227 | leetcode_data = leetcode_anki.helpers.leetcode.LeetcodeData( 228 | start, stop, page_size, list_id 229 | ) 230 | 231 | note_generators: List[Awaitable[LeetcodeNote]] = [] 232 | 233 | task_handles = await leetcode_data.all_problems_handles() 234 | 235 | # TODO: Add a way to specify subsets (in order) from the command line 236 | # (probably from a set of files where each slug is on a separate line, 237 | # and the filename determines the subset name and tag). 238 | # Provide a separate script to generate a grind75.txt file that can be 239 | # used as a subset. 240 | grind75_subset = get_grind75_lookup_table() 241 | 242 | # Sort problems by their location in the Grind 75 list. 243 | # This order is a good order to prioritize problems. 244 | # See https://www.techinterviewhandbook.org/grind75/faq for why. 245 | # All problems not in the subset will sort after these in their original order 246 | # due to Python using a stable sort algorithm. 247 | task_handles.sort(key=lambda x: grind75_subset.get(x, len(grind75_subset))) 248 | 249 | if grind75_only: 250 | task_handles = [x for x in task_handles if x in grind75_subset] 251 | 252 | if not allow_premium: 253 | task_handles = [x for x in task_handles if not await leetcode_data.paid(x)] 254 | 255 | subsets = defaultdict(lambda: {"LeetCode::subset::all"}) 256 | for slug,i in grind75_subset.items(): 257 | if i < 75: 258 | subsets[slug].add(f"LeetCode::subset::{GRIND75_NAME}::base") 259 | else: 260 | subsets[slug].add(f"LeetCode::subset::{GRIND75_NAME}::extended") 261 | 262 | unsuspended_subsets = { 263 | f"LeetCode::subset::{GRIND75_NAME}::base" 264 | } 265 | 266 | def suspend(slug): 267 | # Suspend any cards that are not in an unsuspended subset. 268 | # Note that if they are in one subset that is unsuspended and 269 | # another that is not unsuspended, they won't be suspended. 270 | return len(subsets[slug] & unsuspended_subsets) == 0 271 | 272 | logging.info("Generating flashcards") 273 | for leetcode_task_handle in task_handles: 274 | note_generators.append( 275 | generate_anki_note( 276 | leetcode_data, 277 | leetcode_model, 278 | leetcode_task_handle, 279 | output_description, 280 | subsets, 281 | suspend = suspend 282 | ) 283 | ) 284 | 285 | for leetcode_note in tqdm(note_generators, unit="flashcard"): 286 | leetcode_deck.add_note(await leetcode_note) 287 | 288 | genanki.Package(leetcode_deck).write_to_file(output_file) 289 | 290 | 291 | async def main() -> None: 292 | """ 293 | The main script logic 294 | """ 295 | args = parse_args() 296 | 297 | start, stop, page_size, list_id, output_file = ( 298 | args.start, 299 | args.stop, 300 | args.page_size, 301 | args.list_id, 302 | args.output_file, 303 | ) 304 | # TODO: Add CLI parameters for subset and premium 305 | await generate(start, stop, page_size, list_id, output_file, grind75_only=False, allow_premium=True, output_description=True) 306 | 307 | 308 | if __name__ == "__main__": 309 | loop: asyncio.events.AbstractEventLoop = asyncio.get_event_loop() 310 | loop.run_until_complete(main()) 311 | -------------------------------------------------------------------------------- /test/helpers/test_leetcode.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Optional 2 | from unittest import mock 3 | 4 | import leetcode.models.graphql_data # type: ignore 5 | import leetcode.models.graphql_problemset_question_list # type: ignore 6 | import leetcode.models.graphql_question_contributor # type: ignore 7 | import leetcode.models.graphql_question_detail # type: ignore 8 | import leetcode.models.graphql_question_solution # type: ignore 9 | import leetcode.models.graphql_question_topic_tag # type: ignore 10 | import leetcode.models.graphql_response # type: ignore 11 | import leetcode.models.problems # type: ignore 12 | import leetcode.models.stat # type: ignore 13 | import leetcode.models.stat_status_pair # type: ignore 14 | import pytest 15 | 16 | import leetcode_anki.helpers.leetcode 17 | 18 | QUESTION_DETAIL = leetcode.models.graphql_question_detail.GraphqlQuestionDetail( 19 | freq_bar=1.1, 20 | question_id="1", 21 | question_frontend_id="1", 22 | bound_topic_id=1, 23 | title="test title", 24 | title_slug="test", 25 | content="test content", 26 | translated_title="test", 27 | translated_content="test translated content", 28 | is_paid_only=False, 29 | difficulty="Hard", 30 | likes=1, 31 | dislikes=1, 32 | is_liked=False, 33 | similar_questions="{}", 34 | contributors=[ 35 | leetcode.models.graphql_question_contributor.GraphqlQuestionContributor( 36 | username="testcontributor", 37 | profile_url="test://profile/url", 38 | avatar_url="test://avatar/url", 39 | ) 40 | ], 41 | lang_to_valid_playground="{}", 42 | topic_tags=[ 43 | leetcode.models.graphql_question_topic_tag.GraphqlQuestionTopicTag( 44 | name="test tag", 45 | slug="test-tag", 46 | translated_name="translated test tag", 47 | typename="test type name", 48 | ) 49 | ], 50 | company_tag_stats="{}", 51 | code_snippets="{}", 52 | stats='{"totalSubmissionRaw": 1, "totalAcceptedRaw": 1}', 53 | hints=["test hint 1", "test hint 2"], 54 | solution=[ 55 | leetcode.models.graphql_question_solution.GraphqlQuestionSolution( 56 | id=1, can_see_detail=False, typename="test type name" 57 | ) 58 | ], 59 | status="ac", 60 | sample_test_case="test case", 61 | meta_data="{}", 62 | judger_available=False, 63 | judge_type="large", 64 | mysql_schemas="test schema", 65 | enable_run_code=False, 66 | enable_test_mode=False, 67 | env_info="{}", 68 | ) 69 | 70 | 71 | def dummy_return_question_detail_dict( 72 | question_detail: leetcode.models.graphql_question_detail.GraphqlQuestionDetail, 73 | ) -> Dict[str, leetcode.models.graphql_question_detail.GraphqlQuestionDetail]: 74 | return {"test": question_detail} 75 | 76 | 77 | @mock.patch("os.environ", mock.MagicMock(return_value={"LEETCODE_SESSION_ID": "test"})) 78 | @mock.patch("leetcode.auth", mock.MagicMock()) 79 | class TestLeetcode: 80 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 81 | # `pytest.mark.asyncio`. 82 | @pytest.mark.asyncio 83 | async def test_get_leetcode_api_client(self) -> None: 84 | assert leetcode_anki.helpers.leetcode._get_leetcode_api_client() 85 | 86 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 87 | # `pytest.mark.asyncio`. 88 | @pytest.mark.asyncio 89 | async def test_retry(self) -> None: 90 | decorator = leetcode_anki.helpers.leetcode.retry( 91 | times=3, exceptions=(RuntimeError,), delay=0.01 92 | ) 93 | 94 | async def test() -> str: 95 | return "test" 96 | 97 | func = mock.Mock(side_effect=[RuntimeError, RuntimeError, test()]) 98 | 99 | wrapper = decorator(func) 100 | 101 | assert (await wrapper()) == "test" 102 | 103 | assert func.call_count == 3 104 | 105 | 106 | @mock.patch("leetcode_anki.helpers.leetcode._get_leetcode_api_client", mock.Mock()) 107 | class TestLeetcodeData: 108 | _question_detail_singleton: Optional[ 109 | leetcode.models.graphql_question_detail.GraphqlQuestionDetail 110 | ] = None 111 | _leetcode_data_singleton: Optional[ 112 | leetcode_anki.helpers.leetcode.LeetcodeData 113 | ] = None 114 | 115 | @property 116 | def _question_details( 117 | self, 118 | ) -> leetcode.models.graphql_question_detail.GraphqlQuestionDetail: 119 | question_detail = self._question_detail_singleton 120 | 121 | if not question_detail: 122 | raise ValueError("Question detail must not be None") 123 | 124 | return question_detail 125 | 126 | @property 127 | def _leetcode_data(self) -> leetcode_anki.helpers.leetcode.LeetcodeData: 128 | leetcode_data = self._leetcode_data_singleton 129 | 130 | if not leetcode_data: 131 | raise ValueError("Leetcode data must not be None") 132 | 133 | return leetcode_data 134 | 135 | def setup(self) -> None: 136 | self._question_detail_singleton = QUESTION_DETAIL 137 | self._leetcode_data_singleton = leetcode_anki.helpers.leetcode.LeetcodeData( 138 | 0, 10000 139 | ) 140 | 141 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 142 | # `pytest.mark.asyncio`. 143 | @pytest.mark.asyncio 144 | @mock.patch( 145 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 146 | mock.Mock(return_value=[QUESTION_DETAIL]), 147 | ) 148 | async def test_init(self) -> None: 149 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 150 | 151 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 152 | # `pytest.mark.asyncio`. 153 | @pytest.mark.asyncio 154 | @mock.patch( 155 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 156 | mock.Mock(return_value=[QUESTION_DETAIL]), 157 | ) 158 | async def test_get_description(self) -> None: 159 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 160 | assert (await self._leetcode_data.description("test")) == "test content" 161 | 162 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 163 | # `pytest.mark.asyncio`. 164 | @pytest.mark.asyncio 165 | @mock.patch( 166 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 167 | mock.Mock(return_value=[QUESTION_DETAIL]), 168 | ) 169 | async def test_submissions(self) -> None: 170 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 171 | assert (await self._leetcode_data.description("test")) == "test content" 172 | assert (await self._leetcode_data.submissions_total("test")) == 1 173 | assert (await self._leetcode_data.submissions_accepted("test")) == 1 174 | 175 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 176 | # `pytest.mark.asyncio`. 177 | @pytest.mark.asyncio 178 | @mock.patch( 179 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 180 | mock.Mock(return_value=[QUESTION_DETAIL]), 181 | ) 182 | async def test_difficulty_easy(self) -> None: 183 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 184 | 185 | QUESTION_DETAIL.difficulty = "Easy" 186 | assert "Easy" in (await self._leetcode_data.difficulty("test")) 187 | 188 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 189 | # `pytest.mark.asyncio`. 190 | @pytest.mark.asyncio 191 | @mock.patch( 192 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 193 | mock.Mock(return_value=[QUESTION_DETAIL]), 194 | ) 195 | async def test_difficulty_medium(self) -> None: 196 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 197 | 198 | QUESTION_DETAIL.difficulty = "Medium" 199 | assert "Medium" in (await self._leetcode_data.difficulty("test")) 200 | 201 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 202 | # `pytest.mark.asyncio`. 203 | @pytest.mark.asyncio 204 | @mock.patch( 205 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 206 | mock.Mock(return_value=[QUESTION_DETAIL]), 207 | ) 208 | async def test_difficulty_hard(self) -> None: 209 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 210 | 211 | QUESTION_DETAIL.difficulty = "Hard" 212 | assert "Hard" in (await self._leetcode_data.difficulty("test")) 213 | 214 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 215 | # `pytest.mark.asyncio`. 216 | @pytest.mark.asyncio 217 | @mock.patch( 218 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 219 | mock.Mock(return_value=[QUESTION_DETAIL]), 220 | ) 221 | async def test_paid(self) -> None: 222 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 223 | 224 | assert (await self._leetcode_data.paid("test")) is False 225 | 226 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 227 | # `pytest.mark.asyncio`. 228 | @pytest.mark.asyncio 229 | @mock.patch( 230 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 231 | mock.Mock(return_value=[QUESTION_DETAIL]), 232 | ) 233 | async def test_problem_id(self) -> None: 234 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 235 | 236 | assert (await self._leetcode_data.problem_id("test")) == "1" 237 | 238 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 239 | # `pytest.mark.asyncio`. 240 | @pytest.mark.asyncio 241 | @mock.patch( 242 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 243 | mock.Mock(return_value=[QUESTION_DETAIL]), 244 | ) 245 | async def test_likes(self) -> None: 246 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 247 | 248 | assert (await self._leetcode_data.likes("test")) == 1 249 | 250 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 251 | # `pytest.mark.asyncio`. 252 | @pytest.mark.asyncio 253 | @mock.patch( 254 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 255 | mock.Mock(return_value=[QUESTION_DETAIL]), 256 | ) 257 | async def test_dislikes(self) -> None: 258 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 259 | 260 | assert (await self._leetcode_data.dislikes("test")) == 1 261 | 262 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 263 | # `pytest.mark.asyncio`. 264 | @pytest.mark.asyncio 265 | @mock.patch( 266 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 267 | mock.Mock(return_value=[QUESTION_DETAIL]), 268 | ) 269 | async def test_tags(self) -> None: 270 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 271 | 272 | assert (await self._leetcode_data.tags("test")) == [ 273 | "test-tag", 274 | "difficulty-hard-tag", 275 | ] 276 | 277 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 278 | # `pytest.mark.asyncio`. 279 | @pytest.mark.asyncio 280 | @mock.patch( 281 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 282 | mock.Mock(return_value=[QUESTION_DETAIL]), 283 | ) 284 | async def test_freq_bar(self) -> None: 285 | self._leetcode_data._cache["test"] = QUESTION_DETAIL 286 | 287 | assert (await self._leetcode_data.freq_bar("test")) == 1.1 288 | 289 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 290 | # `pytest.mark.asyncio`. 291 | @pytest.mark.asyncio 292 | @mock.patch( 293 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data", 294 | mock.Mock(return_value=[QUESTION_DETAIL]), 295 | ) 296 | async def test_get_problem_data(self) -> None: 297 | assert self._leetcode_data._cache["test"] == QUESTION_DETAIL 298 | 299 | @mock.patch("time.sleep", mock.Mock()) 300 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 301 | # `pytest.mark.asyncio`. 302 | @pytest.mark.asyncio 303 | async def test_get_problems_data_page(self) -> None: 304 | data = leetcode.models.graphql_data.GraphqlData( 305 | problemset_question_list=leetcode.models.graphql_problemset_question_list.GraphqlProblemsetQuestionList( 306 | questions=[QUESTION_DETAIL], total_num=1 307 | ) 308 | ) 309 | response = leetcode.models.graphql_response.GraphqlResponse(data=data) 310 | self._leetcode_data._api_instance.graphql_post.return_value = response 311 | 312 | assert self._leetcode_data._get_problems_data_page(0, 10, 0) == [ 313 | QUESTION_DETAIL 314 | ] 315 | 316 | # pyre-fixme[56]: Pyre was not able to infer the type of the decorator 317 | # `pytest.mark.asyncio`. 318 | @pytest.mark.asyncio 319 | @mock.patch( 320 | "leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_count", 321 | mock.Mock(return_value=234), 322 | ) 323 | @mock.patch("leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data_page") 324 | async def test_get_problems_data( 325 | self, mock_get_problems_data_page: mock.Mock 326 | ) -> None: 327 | question_list: List[ 328 | leetcode.models.graphql_question_detail.GraphqlQuestionDetail 329 | ] = [QUESTION_DETAIL] * 234 330 | 331 | def dummy( 332 | offset: int, page_size: int, page: int 333 | ) -> List[leetcode.models.graphql_question_detail.GraphqlQuestionDetail]: 334 | return [ 335 | question_list.pop() for _ in range(min(page_size, len(question_list))) 336 | ] 337 | 338 | mock_get_problems_data_page.side_effect = dummy 339 | 340 | assert len(self._leetcode_data._get_problems_data()) == 234 341 | -------------------------------------------------------------------------------- /leetcode_anki/helpers/leetcode.py: -------------------------------------------------------------------------------- 1 | # pylint: disable=missing-module-docstring 2 | import functools 3 | import json 4 | import logging 5 | import math 6 | import os 7 | import time 8 | from functools import cached_property 9 | from typing import Any, Callable, Dict, List, Tuple, Type, TypeVar 10 | 11 | # https://github.com/prius/python-leetcode 12 | import leetcode.api.default_api # type: ignore 13 | import leetcode.api_client # type: ignore 14 | import leetcode.auth # type: ignore 15 | import leetcode.configuration # type: ignore 16 | import leetcode.models.graphql_query # type: ignore 17 | import leetcode.models.graphql_query_get_question_detail_variables # type: ignore 18 | import leetcode.models.graphql_query_problemset_question_list_variables # type: ignore 19 | import leetcode.models.graphql_query_problemset_question_list_variables_filter_input # type: ignore 20 | import leetcode.models.graphql_question_detail # type: ignore 21 | import urllib3 # type: ignore 22 | from tqdm import tqdm # type: ignore 23 | 24 | CACHE_DIR = "cache" 25 | 26 | 27 | def _get_leetcode_api_client() -> leetcode.api.default_api.DefaultApi: 28 | """ 29 | Leetcode API instance constructor. 30 | 31 | This is a singleton, because we don't need to create a separate client 32 | each time 33 | """ 34 | 35 | configuration = leetcode.configuration.Configuration() 36 | 37 | session_id = os.environ["LEETCODE_SESSION_ID"] 38 | csrf_token = leetcode.auth.get_csrf_cookie(session_id) 39 | 40 | configuration.api_key["x-csrftoken"] = csrf_token 41 | configuration.api_key["csrftoken"] = csrf_token 42 | configuration.api_key["LEETCODE_SESSION"] = session_id 43 | configuration.api_key["Referer"] = "https://leetcode.com" 44 | configuration.debug = False 45 | api_instance = leetcode.api.default_api.DefaultApi( 46 | leetcode.api_client.ApiClient(configuration) 47 | ) 48 | 49 | return api_instance 50 | 51 | 52 | _T = TypeVar("_T") 53 | 54 | 55 | class _RetryDecorator: 56 | _times: int 57 | _exceptions: Tuple[Type[Exception]] 58 | _delay: float 59 | 60 | def __init__( 61 | self, times: int, exceptions: Tuple[Type[Exception]], delay: float 62 | ) -> None: 63 | self._times = times 64 | self._exceptions = exceptions 65 | self._delay = delay 66 | 67 | def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: 68 | times: int = self._times 69 | exceptions: Tuple[Type[Exception]] = self._exceptions 70 | delay: float = self._delay 71 | 72 | @functools.wraps(func) 73 | def wrapper(*args: Any, **kwargs: Any) -> _T: 74 | for attempt in range(times - 1): 75 | try: 76 | return func(*args, **kwargs) 77 | except exceptions: 78 | logging.exception( 79 | "Exception occured, try %s/%s", attempt + 1, times 80 | ) 81 | time.sleep(delay) 82 | 83 | logging.error("Last try") 84 | return func(*args, **kwargs) 85 | 86 | return wrapper 87 | 88 | 89 | def retry( 90 | times: int, exceptions: Tuple[Type[Exception]], delay: float 91 | ) -> _RetryDecorator: 92 | """ 93 | Retry Decorator 94 | Retries the wrapped function/method `times` times if the exceptions listed 95 | in `exceptions` are thrown 96 | """ 97 | 98 | return _RetryDecorator(times, exceptions, delay) 99 | 100 | 101 | class LeetcodeData: 102 | """ 103 | Retrieves and caches the data for problems, acquired from the leetcode API. 104 | 105 | This data can be later accessed using provided methods with corresponding 106 | names. 107 | """ 108 | 109 | def __init__( 110 | self, start: int, stop: int, page_size: int = 1000, list_id: str = "" 111 | ) -> None: 112 | """ 113 | Initialize leetcode API and disk cache for API responses 114 | """ 115 | if start < 0: 116 | raise ValueError(f"Start must be non-negative: {start}") 117 | 118 | if stop < 0: 119 | raise ValueError(f"Stop must be non-negative: {start}") 120 | 121 | if page_size < 0: 122 | raise ValueError(f"Page size must be greater than 0: {page_size}") 123 | 124 | if start > stop: 125 | raise ValueError(f"Start (){start}) must be not greater than stop ({stop})") 126 | 127 | self._start = start 128 | self._stop = stop 129 | self._page_size = page_size 130 | self._list_id = list_id 131 | 132 | @cached_property 133 | def _api_instance(self) -> leetcode.api.default_api.DefaultApi: 134 | return _get_leetcode_api_client() 135 | 136 | @cached_property 137 | def _cache( 138 | self, 139 | ) -> Dict[str, leetcode.models.graphql_question_detail.GraphqlQuestionDetail]: 140 | """ 141 | Cached method to return dict (problem_slug -> question details) 142 | """ 143 | problems = self._get_problems_data() 144 | return {problem.title_slug: problem for problem in problems} 145 | 146 | @retry(times=3, exceptions=(urllib3.exceptions.ProtocolError,), delay=5) 147 | def _get_problems_count(self) -> int: 148 | api_instance = self._api_instance 149 | 150 | graphql_request = leetcode.models.graphql_query.GraphqlQuery( 151 | query=""" 152 | query problemsetQuestionList($categorySlug: String, $limit: Int, $skip: Int, $filters: QuestionListFilterInput) { 153 | problemsetQuestionList: questionList( 154 | categorySlug: $categorySlug 155 | limit: $limit 156 | skip: $skip 157 | filters: $filters 158 | ) { 159 | totalNum 160 | } 161 | } 162 | """, 163 | variables=leetcode.models.graphql_query_problemset_question_list_variables.GraphqlQueryProblemsetQuestionListVariables( 164 | category_slug="", 165 | limit=1, 166 | skip=0, 167 | filters=leetcode.models.graphql_query_problemset_question_list_variables_filter_input.GraphqlQueryProblemsetQuestionListVariablesFilterInput( 168 | tags=[], 169 | list_id=self._list_id 170 | # difficulty="MEDIUM", 171 | # status="NOT_STARTED", 172 | # list_id="7p5x763", # Top Amazon Questions 173 | # premium_only=False, 174 | ), 175 | ), 176 | operation_name="problemsetQuestionList", 177 | ) 178 | 179 | time.sleep(2) # Leetcode has a rate limiter 180 | data = api_instance.graphql_post(body=graphql_request).data 181 | 182 | return data.problemset_question_list.total_num or 0 183 | 184 | @retry(times=3, exceptions=(urllib3.exceptions.ProtocolError,), delay=5) 185 | def _get_problems_data_page( 186 | self, offset: int, page_size: int, page: int 187 | ) -> List[leetcode.models.graphql_question_detail.GraphqlQuestionDetail]: 188 | api_instance = self._api_instance 189 | graphql_request = leetcode.models.graphql_query.GraphqlQuery( 190 | query=""" 191 | query problemsetQuestionList($categorySlug: String, $limit: Int, $skip: Int, $filters: QuestionListFilterInput) { 192 | problemsetQuestionList: questionList( 193 | categorySlug: $categorySlug 194 | limit: $limit 195 | skip: $skip 196 | filters: $filters 197 | ) { 198 | questions: data { 199 | questionFrontendId 200 | title 201 | titleSlug 202 | categoryTitle 203 | freqBar 204 | content 205 | isPaidOnly 206 | difficulty 207 | likes 208 | dislikes 209 | topicTags { 210 | name 211 | slug 212 | } 213 | stats 214 | hints 215 | companyTagStats 216 | } 217 | } 218 | } 219 | """, 220 | variables=leetcode.models.graphql_query_problemset_question_list_variables.GraphqlQueryProblemsetQuestionListVariables( 221 | category_slug="", 222 | limit=page_size, 223 | skip=offset + page * page_size, 224 | filters=leetcode.models.graphql_query_problemset_question_list_variables_filter_input.GraphqlQueryProblemsetQuestionListVariablesFilterInput( 225 | list_id=self._list_id 226 | ), 227 | ), 228 | operation_name="problemsetQuestionList", 229 | ) 230 | 231 | time.sleep(2) # Leetcode has a rate limiter 232 | data = api_instance.graphql_post( 233 | body=graphql_request 234 | ).data.problemset_question_list.questions 235 | 236 | return data 237 | 238 | def _get_problems_data( 239 | self, 240 | ) -> List[leetcode.models.graphql_question_detail.GraphqlQuestionDetail]: 241 | problem_count = self._get_problems_count() 242 | 243 | if self._start > problem_count: 244 | raise ValueError( 245 | "Start ({self._start}) is greater than problems count ({problem_count})" 246 | ) 247 | 248 | start = self._start 249 | stop = min(self._stop, problem_count) 250 | 251 | page_size = min(self._page_size, stop - start + 1) 252 | 253 | problems: List[ 254 | leetcode.models.graphql_question_detail.GraphqlQuestionDetail 255 | ] = [] 256 | 257 | logging.info("Fetching %s problems %s per page", stop - start + 1, page_size) 258 | 259 | for page in tqdm( 260 | range(math.ceil((stop - start + 1) / page_size)), 261 | unit="problem", 262 | unit_scale=page_size, 263 | ): 264 | data = self._get_problems_data_page(start, page_size, page) 265 | problems.extend(data) 266 | 267 | return problems 268 | 269 | async def all_problems_handles(self) -> List[str]: 270 | """ 271 | Get all problem handles known. 272 | 273 | Example: ["two-sum", "three-sum"] 274 | """ 275 | return list(self._cache.keys()) 276 | 277 | def _get_problem_data( 278 | self, problem_slug: str 279 | ) -> leetcode.models.graphql_question_detail.GraphqlQuestionDetail: 280 | """ 281 | TODO: Legacy method. Needed in the old architecture. Can be replaced 282 | with direct cache calls later. 283 | """ 284 | cache = self._cache 285 | if problem_slug in cache: 286 | return cache[problem_slug] 287 | 288 | raise ValueError(f"Problem {problem_slug} is not in cache") 289 | 290 | async def _get_description(self, problem_slug: str) -> str: 291 | """ 292 | Problem description 293 | """ 294 | data = self._get_problem_data(problem_slug) 295 | return data.content or "No content" 296 | 297 | async def _stats(self, problem_slug: str) -> Dict[str, str]: 298 | """ 299 | Various stats about problem. Such as number of accepted solutions, etc. 300 | """ 301 | data = self._get_problem_data(problem_slug) 302 | return json.loads(data.stats) 303 | 304 | async def submissions_total(self, problem_slug: str) -> int: 305 | """ 306 | Total number of submissions of the problem 307 | """ 308 | return int((await self._stats(problem_slug))["totalSubmissionRaw"]) 309 | 310 | async def submissions_accepted(self, problem_slug: str) -> int: 311 | """ 312 | Number of accepted submissions of the problem 313 | """ 314 | return int((await self._stats(problem_slug))["totalAcceptedRaw"]) 315 | 316 | async def description(self, problem_slug: str) -> str: 317 | """ 318 | Problem description 319 | """ 320 | return await self._get_description(problem_slug) 321 | 322 | async def difficulty(self, problem_slug: str) -> str: 323 | """ 324 | Problem difficulty. Returns colored HTML version, so it can be used 325 | directly in Anki 326 | """ 327 | data = self._get_problem_data(problem_slug) 328 | diff = data.difficulty 329 | 330 | if diff == "Easy": 331 | return "Easy" 332 | 333 | if diff == "Medium": 334 | return "Medium" 335 | 336 | if diff == "Hard": 337 | return "Hard" 338 | 339 | raise ValueError(f"Incorrect difficulty: {diff}") 340 | 341 | async def paid(self, problem_slug: str) -> str: 342 | """ 343 | Problem's "available for paid subsribers" status 344 | """ 345 | data = self._get_problem_data(problem_slug) 346 | return data.is_paid_only 347 | 348 | async def problem_id(self, problem_slug: str) -> str: 349 | """ 350 | Numerical id of the problem 351 | """ 352 | data = self._get_problem_data(problem_slug) 353 | return data.question_frontend_id 354 | 355 | async def likes(self, problem_slug: str) -> int: 356 | """ 357 | Number of likes for the problem 358 | """ 359 | data = self._get_problem_data(problem_slug) 360 | likes = data.likes 361 | 362 | if not isinstance(likes, int): 363 | raise ValueError(f"Likes should be int: {likes}") 364 | 365 | return likes 366 | 367 | async def dislikes(self, problem_slug: str) -> int: 368 | """ 369 | Number of dislikes for the problem 370 | """ 371 | data = self._get_problem_data(problem_slug) 372 | dislikes = data.dislikes 373 | 374 | if not isinstance(dislikes, int): 375 | raise ValueError(f"Dislikes should be int: {dislikes}") 376 | 377 | return dislikes 378 | 379 | async def tags(self, problem_slug: str) -> List[str]: 380 | """ 381 | List of the tags for this problem (string slugs). 382 | 383 | This will include the following tag groups (for use with the 384 | Hierarchical Tags addon): 385 | - LeetCode::topic:: 386 | - LeetCode::company:: 387 | - LeetCode::difficulty:: 388 | """ 389 | data = self._get_problem_data(problem_slug) 390 | tags = list(map(lambda x: f"LeetCode::topic::{x.slug}", data.topic_tags)) 391 | 392 | company_stats = await self.company_stats(problem_slug) 393 | companies = [entry["slug"] for entry in company_stats] 394 | tags.extend([ 395 | f"LeetCode::company::{company}" 396 | for company in companies 397 | ]) 398 | 399 | tags.append(f"LeetCode::difficulty::{data.difficulty.lower()}") 400 | return tags 401 | 402 | async def total_times_encountered(self, problem_slug: str) -> int: 403 | company_stats = await self.company_stats(problem_slug) 404 | return sum(x["timesEncountered"] for x in company_stats) if company_stats else 0 405 | 406 | async def company_stats(self, problem_slug: str) -> List[Dict[str, Any]]: 407 | data = self._get_problem_data(problem_slug) 408 | company_stats = list(json.loads(data.company_tag_stats).values())[0] 409 | return company_stats 410 | 411 | async def freq_bar(self, problem_slug: str) -> float: 412 | """ 413 | Returns percentage for frequency bar 414 | """ 415 | data = self._get_problem_data(problem_slug) 416 | return data.freq_bar or 0 417 | 418 | async def title(self, problem_slug: str) -> float: 419 | """ 420 | Returns problem title 421 | """ 422 | data = self._get_problem_data(problem_slug) 423 | return data.title 424 | 425 | async def category(self, problem_slug: str) -> float: 426 | """ 427 | Returns problem category title 428 | """ 429 | data = self._get_problem_data(problem_slug) 430 | return data.category_title 431 | -------------------------------------------------------------------------------- /faang_leetcode_slug_stats.csv: -------------------------------------------------------------------------------- 1 | slug,grind75,times_encountered,freq,cumsum,cumfreq 2 | number-of-islands,True,815,0.025490257404685204,815,0.025490257404685204 3 | k-closest-points-to-origin,True,518,0.016201169736965566,1333,0.04169142714165077 4 | sum-of-total-strength-of-wizards,False,516,0.016138616958058363,1849,0.05783004409970913 5 | meeting-rooms-ii,False,420,0.01313608357051262,2269,0.07096612767022174 6 | two-sum,True,388,0.012135239107997372,2657,0.08310136677821912 7 | substring-with-largest-variance,False,342,0.010696525193131705,2999,0.09379789197135083 8 | group-anagrams,False,272,0.008507177931379601,3271,0.10230506990273043 9 | sliding-window-maximum,False,270,0.008444625152472398,3541,0.11074969505520282 10 | merge-k-sorted-lists,True,268,0.008382072373565195,3809,0.11913176742876802 11 | roman-to-integer,False,267,0.008350795984111594,4076,0.1274825634128796 12 | course-schedule,True,248,0.007756544584493166,4324,0.1352391079973728 13 | longest-substring-without-repeating-characters,True,225,0.007037187627060332,4549,0.1422762956244331 14 | random-pick-with-weight,False,220,0.006880805679792325,4769,0.14915710130422544 15 | binary-tree-vertical-order-traversal,False,205,0.006411659837988303,4974,0.15556876114221374 16 | my-calendar-i,False,188,0.005879961217277078,5162,0.16144872235949081 17 | step-by-step-directions-from-a-binary-tree-node-to-another,False,180,0.0056297501016482655,5342,0.16707847246113908 18 | concatenated-words,False,180,0.0056297501016482655,5522,0.17270822256278734 19 | maximum-subarray,True,180,0.0056297501016482655,5702,0.17833797266443563 20 | lowest-common-ancestor-of-a-binary-tree,True,177,0.005535920933287461,5879,0.18387389359772308 21 | course-schedule-ii,False,176,0.005504644543833859,6055,0.18937853814155695 22 | trapping-rain-water,True,175,0.005473368154380259,6230,0.1948519062959372 23 | stock-price-fluctuation,False,175,0.005473368154380259,6405,0.20032527445031745 24 | serialize-and-deserialize-binary-tree,True,168,0.005254433428205048,6573,0.2055797078785225 25 | analyze-user-website-visit-pattern,False,162,0.005066775091483439,6735,0.21064648297000593 26 | merge-intervals,True,162,0.005066775091483439,6897,0.2157132580614894 27 | median-of-two-sorted-arrays,False,159,0.004972945923122635,7056,0.22068620398461203 28 | find-all-possible-recipes-from-given-supplies,False,155,0.004847840365308229,7211,0.22553404434992025 29 | reorder-data-in-log-files,False,153,0.004785287586401026,7364,0.23031933193632126 30 | add-two-numbers,False,150,0.004691458418040221,7514,0.23501079035436148 31 | cheapest-flights-within-k-stops,False,150,0.004691458418040221,7664,0.2397022487724017 32 | valid-palindrome-ii,False,144,0.004503800081318613,7808,0.24420604885372033 33 | binary-tree-right-side-view,True,144,0.004503800081318613,7952,0.24870984893503895 34 | top-k-frequent-words,False,140,0.004378694523504207,8092,0.25308854345854315 35 | best-time-to-buy-and-sell-stock,True,140,0.004378694523504207,8232,0.25746723798204735 36 | find-leaves-of-binary-tree,False,138,0.004316141744597004,8370,0.26178337972664434 37 | subarray-sum-equals-k,False,138,0.004316141744597004,8508,0.2660995214712414 38 | integer-to-roman,False,132,0.0041284834078753945,8640,0.27022800487911675 39 | shortest-path-in-a-grid-with-obstacles-elimination,False,126,0.003940825071153786,8766,0.27416882995027053 40 | reorganize-string,False,126,0.003940825071153786,8892,0.2781096550214243 41 | dot-product-of-two-sparse-vectors,False,124,0.003878272292246583,9016,0.2819879273136709 42 | 3sum,True,123,0.0038469959027929816,9139,0.28583492321646387 43 | rotting-oranges,True,123,0.0038469959027929816,9262,0.2896819191192569 44 | convert-sorted-list-to-binary-search-tree,False,120,0.003753166734432177,9382,0.29343508585368905 45 | buildings-with-an-ocean-view,False,120,0.003753166734432177,9502,0.2971882525881212 46 | connecting-cities-with-minimum-cost,False,120,0.003753166734432177,9622,0.3009414193225534 47 | word-search-ii,False,120,0.003753166734432177,9742,0.3046945860569856 48 | swim-in-rising-water,False,119,0.0037218903449785755,9861,0.3084164764019642 49 | minimum-health-to-beat-game,False,117,0.003659337566071373,9978,0.3120758139680355 50 | all-nodes-distance-k-in-binary-tree,False,116,0.0036280611766177713,10094,0.3157038751446533 51 | plates-between-candles,False,116,0.0036280611766177713,10210,0.31933193632127105 52 | max-area-of-island,False,115,0.00359678478716417,10325,0.32292872110843523 53 | shortest-path-in-binary-matrix,False,114,0.0035655083977105683,10439,0.3264942295061458 54 | evaluate-division,False,114,0.0035655083977105683,10553,0.3300597379038564 55 | find-k-closest-elements,False,114,0.0035655083977105683,10667,0.3336252463015669 56 | longest-consecutive-sequence,False,114,0.0035655083977105683,10781,0.3371907546992775 57 | minimum-remove-to-make-valid-parentheses,False,112,0.003502955618803365,10893,0.3406937103180809 58 | make-array-zero-by-subtracting-equal-amounts,False,110,0.0034404028398961626,11003,0.34413411315797704 59 | unique-paths,True,105,0.003284020892628155,11108,0.3474181340506052 60 | decode-string,False,105,0.003284020892628155,11213,0.35070215494323337 61 | insert-delete-getrandom-o1,False,105,0.003284020892628155,11318,0.3539861758358615 62 | minimum-number-of-moves-to-make-palindrome,False,104,0.0032527445031745534,11422,0.35723892033903604 63 | longest-palindromic-substring,True,104,0.0032527445031745534,11526,0.3604916648422106 64 | find-triangular-sum-of-an-array,False,104,0.0032527445031745534,11630,0.36374440934538516 65 | missing-number,False,102,0.0031901917242673507,11732,0.36693460106965253 66 | container-with-most-water,True,102,0.0031901917242673507,11834,0.37012479279391985 67 | maximum-number-of-books-you-can-take,False,100,0.0031276389453601477,11934,0.37325243173928 68 | binary-search-tree-iterator,False,96,0.0030025333875457415,12030,0.37625496512682577 69 | contains-duplicate,True,96,0.0030025333875457415,12126,0.3792574985143715 70 | coin-change,True,93,0.0029087042191849374,12219,0.38216620273355645 71 | binary-tree-zigzag-level-order-traversal,False,93,0.0029087042191849374,12312,0.3850749069527414 72 | validate-binary-search-tree,True,92,0.002877427829731336,12404,0.3879523347824727 73 | range-sum-of-bst,False,92,0.002877427829731336,12496,0.39082976261220403 74 | race-car,False,92,0.002877427829731336,12588,0.39370719044193536 75 | integer-to-english-words,False,90,0.0028148750508241328,12678,0.39652206549275953 76 | generate-parentheses,False,90,0.0028148750508241328,12768,0.39933694054358365 77 | sum-of-subarray-ranges,False,90,0.0028148750508241328,12858,0.40215181559440777 78 | evaluate-reverse-polish-notation,True,87,0.0027210458824633286,12945,0.4048728614768711 79 | diameter-of-binary-tree,True,87,0.0027210458824633286,13032,0.40759390735933443 80 | maximum-number-of-robots-within-budget,False,84,0.002627216714102524,13116,0.41022112407343697 81 | merge-sorted-array,False,84,0.002627216714102524,13200,0.4128483407875395 82 | search-suggestions-system,False,81,0.0025333875457417194,13281,0.4153817283332812 83 | find-the-duplicate-number,False,80,0.0025021111562881183,13361,0.4178838394895693 84 | majority-element,True,80,0.0025021111562881183,13441,0.42038595064585743 85 | flood-fill,True,80,0.0025021111562881183,13521,0.42288806180214555 86 | add-bold-tag-in-string,False,80,0.0025021111562881183,13601,0.4253901729584337 87 | copy-list-with-random-pointer,False,80,0.0025021111562881183,13681,0.4278922841147218 88 | design-tic-tac-toe,False,80,0.0025021111562881183,13761,0.4303943952710099 89 | logger-rate-limiter,False,76,0.002377005598473712,13837,0.4327714008694836 90 | max-consecutive-ones-iii,False,76,0.002377005598473712,13913,0.4351484064679573 91 | making-a-large-island,False,75,0.0023457292090201106,13988,0.4374941356769774 92 | minimum-number-of-keypresses,False,75,0.0023457292090201106,14063,0.4398398648859976 93 | maximum-average-subtree,False,75,0.0023457292090201106,14138,0.4421855940950177 94 | powx-n,False,74,0.002314452819566509,14212,0.44450004691458417 95 | detonate-the-maximum-bombs,False,72,0.0022519000406593065,14284,0.4467519469552435 96 | palindrome-linked-list,False,72,0.0022519000406593065,14356,0.4490038469959028 97 | find-first-and-last-position-of-element-in-sorted-array,False,72,0.0022519000406593065,14428,0.45125574703656207 98 | amount-of-new-area-painted-each-day,False,72,0.0022519000406593065,14500,0.4535076470772214 99 | time-based-key-value-store,True,72,0.0022519000406593065,14572,0.4557595471178807 100 | next-permutation,False,72,0.0022519000406593065,14644,0.45801144715854003 101 | maximize-score-after-n-operations,False,70,0.0021893472617521034,14714,0.4602007944202921 102 | flatten-binary-tree-to-linked-list,False,70,0.0021893472617521034,14784,0.46239014168204423 103 | two-sum-iv-input-is-a-bst,False,70,0.0021893472617521034,14854,0.4645794889437963 104 | number-of-ways-to-select-buildings,False,69,0.002158070872298502,14923,0.4667375598160948 105 | search-a-2d-matrix,False,69,0.002158070872298502,14992,0.46889563068839335 106 | text-justification,False,69,0.002158070872298502,15061,0.4710537015606918 107 | prison-cells-after-n-days,False,68,0.0021267944828449003,15129,0.47318049604353674 108 | detect-squares,False,68,0.0021267944828449003,15197,0.47530729052638165 109 | house-robber,False,68,0.0021267944828449003,15265,0.4774340850092265 110 | pacific-atlantic-water-flow,False,68,0.0021267944828449003,15333,0.47956087949207143 111 | find-peak-element,False,66,0.0020642417039376973,15399,0.48162512119600914 112 | minimum-number-of-increments-on-subarrays-to-form-a-target-array,False,65,0.0020329653144840957,15464,0.48365808651049325 113 | first-unique-character-in-a-string,False,64,0.0020016889250304946,15528,0.48565977543552374 114 | rotate-image,False,63,0.001970412535576893,15591,0.48763018797110064 115 | find-original-array-from-doubled-array,False,60,0.0018765833672160885,15651,0.4895067713383167 116 | snapshot-array,False,60,0.0018765833672160885,15711,0.4913833547055328 117 | invert-binary-tree,True,60,0.0018765833672160885,15771,0.49325993807274887 118 | range-module,False,60,0.0018765833672160885,15831,0.49513652143996495 119 | product-of-the-last-k-numbers,False,60,0.0018765833672160885,15891,0.4970131048071811 120 | the-number-of-weak-characters-in-the-game,False,60,0.0018765833672160885,15951,0.49888968817439716 121 | maximum-units-on-a-truck,False,60,0.0018765833672160885,16011,0.5007662715416132 122 | valid-palindrome,True,58,0.0018140305883088857,16069,0.5025803021299221 123 | search-in-rotated-sorted-array,True,58,0.0018140305883088857,16127,0.504394332718231 124 | 3sum-closest,False,57,0.0017827541988552841,16184,0.5061770869170863 125 | minimum-add-to-make-parentheses-valid,False,57,0.0017827541988552841,16241,0.5079598411159416 126 | strobogrammatic-number,False,57,0.0017827541988552841,16298,0.5097425953147968 127 | jump-game-ii,False,57,0.0017827541988552841,16355,0.5115253495136521 128 | wildcard-matching,False,56,0.0017514778094016826,16411,0.5132768273230538 129 | word-ladder-ii,False,56,0.0017514778094016826,16467,0.5150283051324555 130 | count-of-smaller-numbers-after-self,False,56,0.0017514778094016826,16523,0.5167797829418572 131 | populating-next-right-pointers-in-each-node-ii,False,55,0.0017202014199480813,16578,0.5184999843618052 132 | flatten-nested-list-iterator,False,54,0.0016889250304944797,16632,0.5201889093922998 133 | minimum-cost-to-make-at-least-one-valid-path-in-a-grid,False,54,0.0016889250304944797,16686,0.5218778344227942 134 | total-appeal-of-a-string,False,54,0.0016889250304944797,16740,0.5235667594532887 135 | combination-sum,True,54,0.0016889250304944797,16794,0.5252556844837832 136 | longest-valid-parentheses,False,54,0.0016889250304944797,16848,0.5269446095142777 137 | next-greater-element-i,False,52,0.0016263722515872767,16900,0.5285709817658649 138 | symmetric-tree,False,52,0.0016263722515872767,16952,0.5301973540174523 139 | 01-matrix,True,52,0.0016263722515872767,17004,0.5318237262690395 140 | basic-calculator-iii,False,52,0.0016263722515872767,17056,0.5334500985206267 141 | happy-number,False,51,0.0015950958621336754,17107,0.5350451943827604 142 | group-shifted-strings,False,51,0.0015950958621336754,17158,0.5366402902448941 143 | 4sum,False,51,0.0015950958621336754,17209,0.5382353861070278 144 | sort-colors,True,51,0.0015950958621336754,17260,0.5398304819691615 145 | find-median-from-data-stream,True,50,0.0015638194726800738,17310,0.5413943014418415 146 | first-bad-version,True,50,0.0015638194726800738,17360,0.5429581209145217 147 | smallest-subtree-with-all-the-deepest-nodes,False,50,0.0015638194726800738,17410,0.5445219403872017 148 | network-delay-time,False,50,0.0015638194726800738,17460,0.5460857598598817 149 | construct-binary-tree-from-preorder-and-inorder-traversal,True,50,0.0015638194726800738,17510,0.5476495793325619 150 | all-elements-in-two-binary-search-trees,False,50,0.0015638194726800738,17560,0.5492133988052419 151 | longest-increasing-subsequence,False,48,0.0015012666937728708,17608,0.5507146654990148 152 | longest-duplicate-substring,False,48,0.0015012666937728708,17656,0.5522159321927876 153 | path-sum,False,48,0.0015012666937728708,17704,0.5537171988865606 154 | sort-an-array,False,48,0.0015012666937728708,17752,0.5552184655803334 155 | basic-calculator,True,48,0.0015012666937728708,17800,0.5567197322741063 156 | sum-of-subarray-minimums,False,48,0.0015012666937728708,17848,0.5582209989678791 157 | binary-tree-maximum-path-sum,False,48,0.0015012666937728708,17896,0.5597222656616521 158 | unique-paths-ii,False,48,0.0015012666937728708,17944,0.5612235323554249 159 | two-sum-ii-input-array-is-sorted,False,48,0.0015012666937728708,17992,0.5627247990491978 160 | maximum-depth-of-binary-tree,True,48,0.0015012666937728708,18040,0.5642260657429706 161 | find-the-difference,False,48,0.0015012666937728708,18088,0.5657273324367436 162 | minimum-number-of-refueling-stops,False,48,0.0015012666937728708,18136,0.5672285991305164 163 | ransom-note,True,48,0.0015012666937728708,18184,0.5687298658242892 164 | next-greater-element-iii,False,48,0.0015012666937728708,18232,0.5702311325180621 165 | implement-trie-prefix-tree,True,48,0.0015012666937728708,18280,0.5717323992118349 166 | koko-eating-bananas,False,48,0.0015012666937728708,18328,0.5732336659056079 167 | same-tree,False,48,0.0015012666937728708,18376,0.5747349325993807 168 | alien-dictionary,False,48,0.0015012666937728708,18424,0.5762361992931536 169 | range-addition,False,46,0.001438713914865668,18470,0.5776749132080192 170 | kth-smallest-element-in-a-sorted-matrix,False,45,0.0014074375254120664,18515,0.5790823507334313 171 | reconstruct-itinerary,False,45,0.0014074375254120664,18560,0.5804897882588435 172 | range-sum-query-2d-immutable,False,44,0.0013761611359584648,18604,0.5818659493948019 173 | number-of-good-paths,False,44,0.0013761611359584648,18648,0.5832421105307604 174 | nested-list-weight-sum,False,44,0.0013761611359584648,18692,0.5846182716667188 175 | recover-binary-search-tree,False,44,0.0013761611359584648,18736,0.5859944328026773 176 | is-graph-bipartite,False,44,0.0013761611359584648,18780,0.5873705939386358 177 | average-of-levels-in-binary-tree,False,44,0.0013761611359584648,18824,0.5887467550745942 178 | russian-doll-envelopes,False,44,0.0013761611359584648,18868,0.5901229162105527 179 | minimum-size-subarray-sum,False,44,0.0013761611359584648,18912,0.5914990773465111 180 | longest-common-prefix,False,43,0.0013448847465048635,18955,0.5928439620930159 181 | remove-invalid-parentheses,False,42,0.001313608357051262,18997,0.5941575704500672 182 | remove-nth-node-from-end-of-list,False,42,0.001313608357051262,19039,0.5954711788071185 183 | regular-expression-matching,False,42,0.001313608357051262,19081,0.5967847871641697 184 | kth-largest-element-in-a-stream,False,42,0.001313608357051262,19123,0.598098395521221 185 | shortest-way-to-form-string,False,42,0.001313608357051262,19165,0.5994120038782723 186 | design-parking-system,False,42,0.001313608357051262,19207,0.6007256122353235 187 | decode-ways,False,42,0.001313608357051262,19249,0.6020392205923748 188 | single-element-in-a-sorted-array,False,42,0.001313608357051262,19291,0.6033528289494261 189 | rotate-array,False,42,0.001313608357051262,19333,0.6046664373064773 190 | h-index,False,42,0.001313608357051262,19375,0.6059800456635286 191 | minimum-path-sum,False,42,0.001313608357051262,19417,0.6072936540205799 192 | validate-binary-tree-nodes,False,42,0.001313608357051262,19459,0.6086072623776311 193 | valid-word-abbreviation,False,42,0.001313608357051262,19501,0.6099208707346824 194 | intersection-of-two-arrays,False,40,0.0012510555781440592,19541,0.6111719263128265 195 | sum-of-prefix-scores-of-strings,False,40,0.0012510555781440592,19581,0.6124229818909706 196 | maximum-product-subarray,False,40,0.0012510555781440592,19621,0.6136740374691145 197 | surrounded-regions,False,40,0.0012510555781440592,19661,0.6149250930472586 198 | move-zeroes,False,40,0.0012510555781440592,19701,0.6161761486254027 199 | sequentially-ordinal-rank-tracker,False,40,0.0012510555781440592,19741,0.6174272042035468 200 | minimum-time-difference,False,40,0.0012510555781440592,19781,0.6186782597816908 201 | merge-two-binary-trees,False,40,0.0012510555781440592,19821,0.6199293153598349 202 | find-pivot-index,False,40,0.0012510555781440592,19861,0.621180370937979 203 | next-greater-element-ii,False,39,0.0012197791886904576,19900,0.6224001501266694 204 | maximum-length-of-subarray-with-positive-product,False,39,0.0012197791886904576,19939,0.6236199293153598 205 | binary-tree-level-order-traversal,True,39,0.0012197791886904576,19978,0.6248397085040502 206 | maximum-size-subarray-sum-equals-k,False,39,0.0012197791886904576,20017,0.6260594876927408 207 | read-n-characters-given-read4,False,39,0.0012197791886904576,20056,0.6272792668814312 208 | reverse-nodes-in-k-group,False,38,0.001188502799236856,20094,0.6284677696806681 209 | first-missing-positive,False,38,0.001188502799236856,20132,0.629656272479905 210 | shortest-bridge,False,36,0.0011259500203296532,20168,0.6307822225002345 211 | rle-iterator,False,36,0.0011259500203296532,20204,0.6319081725205642 212 | best-time-to-buy-and-sell-stock-ii,False,36,0.0011259500203296532,20240,0.6330341225408939 213 | sentence-similarity-ii,False,36,0.0011259500203296532,20276,0.6341600725612235 214 | target-sum,False,36,0.0011259500203296532,20312,0.6352860225815532 215 | kth-smallest-element-in-a-bst,True,36,0.0011259500203296532,20348,0.6364119726018829 216 | balanced-binary-tree,True,36,0.0011259500203296532,20384,0.6375379226222125 217 | sum-of-distances-in-tree,False,36,0.0011259500203296532,20420,0.6386638726425421 218 | valid-parenthesis-string,False,36,0.0011259500203296532,20456,0.6397898226628718 219 | split-array-largest-sum,False,36,0.0011259500203296532,20492,0.6409157726832014 220 | squares-of-a-sorted-array,False,36,0.0011259500203296532,20528,0.6420417227035311 221 | inorder-successor-in-bst,False,36,0.0011259500203296532,20564,0.6431676727238608 222 | longest-arithmetic-subsequence,False,36,0.0011259500203296532,20600,0.6442936227441904 223 | bulls-and-cows,False,36,0.0011259500203296532,20636,0.6454195727645201 224 | smallest-string-with-swaps,False,35,0.0010946736308760517,20671,0.6465142463953961 225 | range-sum-query-2d-mutable,False,35,0.0010946736308760517,20706,0.6476089200262721 226 | odd-even-jump,False,35,0.0010946736308760517,20741,0.6487035936571482 227 | sort-list,False,35,0.0010946736308760517,20776,0.6497982672880243 228 | reverse-linked-list,True,34,0.0010633972414224502,20810,0.6508616645294467 229 | permutations,True,34,0.0010633972414224502,20844,0.6519250617708692 230 | robot-room-cleaner,False,34,0.0010633972414224502,20878,0.6529884590122916 231 | boundary-of-binary-tree,False,33,0.0010321208519688486,20911,0.6540205798642604 232 | battleships-in-a-board,False,33,0.0010321208519688486,20944,0.6550527007162293 233 | sum-of-left-leaves,False,32,0.0010008444625152473,20976,0.6560535451787446 234 | find-duplicate-subtrees,False,32,0.0010008444625152473,21008,0.6570543896412598 235 | slowest-key,False,32,0.0010008444625152473,21040,0.6580552341037751 236 | house-robber-iii,False,32,0.0010008444625152473,21072,0.6590560785662903 237 | add-binary,True,32,0.0010008444625152473,21104,0.6600569230288056 238 | construct-binary-tree-from-string,False,32,0.0010008444625152473,21136,0.6610577674913208 239 | count-complete-tree-nodes,False,32,0.0010008444625152473,21168,0.6620586119538361 240 | encode-and-decode-tinyurl,False,32,0.0010008444625152473,21200,0.6630594564163513 241 | partition-equal-subset-sum,True,32,0.0010008444625152473,21232,0.6640603008788666 242 | design-circular-queue,False,32,0.0010008444625152473,21264,0.6650611453413818 243 | max-points-on-a-line,False,32,0.0010008444625152473,21296,0.6660619898038971 244 | maximum-and-sum-of-array,False,32,0.0010008444625152473,21328,0.6670628342664123 245 | maximum-width-of-binary-tree,False,32,0.0010008444625152473,21360,0.6680636787289276 246 | furthest-building-you-can-reach,False,30,0.0009382916836080443,21390,0.6690019704125356 247 | all-possible-full-binary-trees,False,30,0.0009382916836080443,21420,0.6699402620961437 248 | find-two-non-overlapping-sub-arrays-each-with-target-sum,False,30,0.0009382916836080443,21450,0.6708785537797517 249 | frequency-of-the-most-frequent-element,False,30,0.0009382916836080443,21480,0.6718168454633597 250 | sort-integers-by-the-power-value,False,30,0.0009382916836080443,21510,0.6727551371469678 251 | subtree-of-another-tree,False,30,0.0009382916836080443,21540,0.6736934288305758 252 | sum-root-to-leaf-numbers,False,30,0.0009382916836080443,21570,0.6746317205141839 253 | longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit,False,30,0.0009382916836080443,21600,0.6755700121977919 254 | sliding-puzzle,False,30,0.0009382916836080443,21630,0.6765083038813999 255 | similar-string-groups,False,30,0.0009382916836080443,21660,0.677446595565008 256 | number-of-distinct-islands,False,30,0.0009382916836080443,21690,0.678384887248616 257 | multiply-strings,False,30,0.0009382916836080443,21720,0.679323178932224 258 | most-stones-removed-with-same-row-or-column,False,30,0.0009382916836080443,21750,0.6802614706158321 259 | minimum-operations-to-reduce-x-to-zero,False,30,0.0009382916836080443,21780,0.6811997622994401 260 | validate-stack-sequences,False,30,0.0009382916836080443,21810,0.6821380539830482 261 | partition-array-such-that-maximum-difference-is-k,False,30,0.0009382916836080443,21840,0.6830763456666562 262 | partition-to-k-equal-sum-subsets,False,30,0.0009382916836080443,21870,0.6840146373502642 263 | path-with-maximum-gold,False,30,0.0009382916836080443,21900,0.6849529290338723 264 | path-with-maximum-minimum-value,False,30,0.0009382916836080443,21930,0.6858912207174803 265 | meeting-rooms-iii,False,30,0.0009382916836080443,21960,0.6868295124010885 266 | find-and-replace-in-string,False,30,0.0009382916836080443,21990,0.6877678040846965 267 | design-browser-history,False,30,0.0009382916836080443,22020,0.6887060957683045 268 | design-hashmap,False,30,0.0009382916836080443,22050,0.6896443874519126 269 | the-maze-ii,False,30,0.0009382916836080443,22080,0.6905826791355206 270 | shortest-path-visiting-all-nodes,False,30,0.0009382916836080443,22110,0.6915209708191287 271 | is-subsequence,False,30,0.0009382916836080443,22140,0.6924592625027367 272 | intersection-of-two-arrays-ii,False,30,0.0009382916836080443,22170,0.6933975541863447 273 | open-the-lock,False,28,0.0008757389047008413,22198,0.6942732930910456 274 | gas-station,False,28,0.0008757389047008413,22226,0.6951490319957464 275 | next-greater-node-in-linked-list,False,28,0.0008757389047008413,22254,0.6960247709004472 276 | number-of-provinces,False,28,0.0008757389047008413,22282,0.6969005098051481 277 | break-a-palindrome,False,28,0.0008757389047008413,22310,0.6977762487098489 278 | majority-element-ii,False,28,0.0008757389047008413,22338,0.6986519876145498 279 | serialize-and-deserialize-bst,False,28,0.0008757389047008413,22366,0.6995277265192507 280 | isomorphic-strings,False,28,0.0008757389047008413,22394,0.7004034654239515 281 | plus-one,False,28,0.0008757389047008413,22422,0.7012792043286523 282 | lfu-cache,False,28,0.0008757389047008413,22450,0.7021549432333531 283 | subarrays-with-k-different-integers,False,28,0.0008757389047008413,22478,0.703030682138054 284 | range-sum-query-mutable,False,28,0.0008757389047008413,22506,0.7039064210427548 285 | number-of-atoms,False,28,0.0008757389047008413,22534,0.7047821599474556 286 | convert-binary-search-tree-to-sorted-doubly-linked-list,False,28,0.0008757389047008413,22562,0.7056578988521565 287 | design-add-and-search-words-data-structure,False,28,0.0008757389047008413,22590,0.7065336377568574 288 | unique-number-of-occurrences,False,28,0.0008757389047008413,22618,0.7074093766615582 289 | count-of-range-sum,False,28,0.0008757389047008413,22646,0.7082851155662591 290 | single-threaded-cpu,False,27,0.0008444625152472399,22673,0.7091295780815062 291 | valid-anagram,True,27,0.0008444625152472399,22700,0.7099740405967535 292 | find-the-k-sum-of-an-array,False,27,0.0008444625152472399,22727,0.7108185031120008 293 | find-the-index-of-the-first-occurrence-in-a-string,False,27,0.0008444625152472399,22754,0.711662965627248 294 | sort-array-by-parity,False,27,0.0008444625152472399,22781,0.7125074281424952 295 | minimum-area-rectangle-ii,False,27,0.0008444625152472399,22808,0.7133518906577425 296 | sudoku-solver,False,27,0.0008444625152472399,22835,0.7141963531729897 297 | snakes-and-ladders,False,27,0.0008444625152472399,22862,0.715040815688237 298 | expression-add-operators,False,27,0.0008444625152472399,22889,0.7158852782034842 299 | running-sum-of-1d-array,False,26,0.0008131861257936383,22915,0.7166984643292779 300 | search-insert-position,False,26,0.0008131861257936383,22941,0.7175116504550715 301 | minimum-adjacent-swaps-to-make-a-valid-array,False,26,0.0008131861257936383,22967,0.7183248365808651 302 | longest-word-in-dictionary,False,25,0.0007819097363400369,22992,0.7191067463172052 303 | where-will-the-ball-fall,False,25,0.0007819097363400369,23017,0.7198886560535451 304 | optimal-account-balancing,False,25,0.0007819097363400369,23042,0.7206705657898852 305 | maximal-rectangle,False,25,0.0007819097363400369,23067,0.7214524755262253 306 | different-ways-to-add-parentheses,False,25,0.0007819097363400369,23092,0.7222343852625653 307 | longest-palindrome-by-concatenating-two-letter-words,False,25,0.0007819097363400369,23117,0.7230162949989053 308 | palindrome-number,False,25,0.0007819097363400369,23142,0.7237982047352454 309 | construct-binary-tree-from-preorder-and-postorder-traversal,False,25,0.0007819097363400369,23167,0.7245801144715854 310 | campus-bikes-ii,False,25,0.0007819097363400369,23192,0.7253620242079254 311 | insert-delete-getrandom-o1-duplicates-allowed,False,25,0.0007819097363400369,23217,0.7261439339442655 312 | count-words-obtained-after-adding-a-letter,False,25,0.0007819097363400369,23242,0.7269258436806055 313 | minimum-area-rectangle,False,25,0.0007819097363400369,23267,0.7277077534169456 314 | binary-search,True,24,0.0007506333468864354,23291,0.728458386763832 315 | deepest-leaves-sum,False,24,0.0007506333468864354,23315,0.7292090201107184 316 | task-scheduler,True,24,0.0007506333468864354,23339,0.7299596534576048 317 | capacity-to-ship-packages-within-d-days,False,24,0.0007506333468864354,23363,0.7307102868044912 318 | kth-ancestor-of-a-tree-node,False,24,0.0007506333468864354,23387,0.7314609201513778 319 | linked-list-cycle,True,24,0.0007506333468864354,23411,0.7322115534982642 320 | longest-line-of-consecutive-one-in-matrix,False,24,0.0007506333468864354,23435,0.7329621868451506 321 | top-k-frequent-elements,False,24,0.0007506333468864354,23459,0.733712820192037 322 | smallest-range-covering-elements-from-k-lists,False,24,0.0007506333468864354,23483,0.7344634535389235 323 | k-th-symbol-in-grammar,False,24,0.0007506333468864354,23507,0.7352140868858099 324 | palindrome-partitioning,False,24,0.0007506333468864354,23531,0.7359647202326963 325 | frog-position-after-t-seconds,False,24,0.0007506333468864354,23555,0.7367153535795827 326 | get-the-maximum-score,False,24,0.0007506333468864354,23579,0.7374659869264693 327 | product-of-two-run-length-encoded-arrays,False,24,0.0007506333468864354,23603,0.7382166202733557 328 | build-binary-expression-tree-from-infix-expression,False,24,0.0007506333468864354,23627,0.7389672536202421 329 | island-perimeter,False,24,0.0007506333468864354,23651,0.7397178869671285 330 | maximum-score-of-a-node-sequence,False,24,0.0007506333468864354,23675,0.740468520314015 331 | partition-labels,False,24,0.0007506333468864354,23699,0.7412191536609014 332 | campus-bikes,False,24,0.0007506333468864354,23723,0.7419697870077878 333 | path-sum-ii,False,24,0.0007506333468864354,23747,0.7427204203546742 334 | shortest-unsorted-continuous-subarray,False,24,0.0007506333468864354,23771,0.7434710537015607 335 | design-file-system,False,24,0.0007506333468864354,23795,0.7442216870484472 336 | delete-nodes-and-return-forest,False,24,0.0007506333468864354,23819,0.7449723203953336 337 | leftmost-column-with-at-least-a-one,False,24,0.0007506333468864354,23843,0.74572295374222 338 | binary-tree-postorder-traversal,False,24,0.0007506333468864354,23867,0.7464735870891064 339 | binary-search-tree-to-greater-sum-tree,False,24,0.0007506333468864354,23891,0.7472242204359929 340 | design-circular-deque,False,24,0.0007506333468864354,23915,0.7479748537828793 341 | maximum-twin-sum-of-a-linked-list,False,24,0.0007506333468864354,23939,0.7487254871297657 342 | serialize-and-deserialize-n-ary-tree,False,24,0.0007506333468864354,23963,0.7494761204766521 343 | best-time-to-buy-and-sell-stock-iv,False,24,0.0007506333468864354,23987,0.7502267538235387 344 | longest-binary-subsequence-less-than-or-equal-to-k,False,24,0.0007506333468864354,24011,0.7509773871704251 345 | sentence-screen-fitting,False,24,0.0007506333468864354,24035,0.7517280205173115 346 | longest-substring-with-at-most-k-distinct-characters,False,24,0.0007506333468864354,24059,0.7524786538641979 347 | edit-distance,False,24,0.0007506333468864354,24083,0.7532292872110844 348 | number-of-laser-beams-in-a-bank,False,24,0.0007506333468864354,24107,0.7539799205579708 349 | complete-binary-tree-inserter,False,24,0.0007506333468864354,24131,0.7547305539048572 350 | number-of-good-ways-to-split-a-string,False,24,0.0007506333468864354,24155,0.7554811872517436 351 | number-of-wonderful-substrings,False,24,0.0007506333468864354,24179,0.7562318205986301 352 | find-the-kth-largest-integer-in-the-array,False,24,0.0007506333468864354,24203,0.7569824539455166 353 | word-break-ii,False,24,0.0007506333468864354,24227,0.757733087292403 354 | sort-characters-by-frequency,False,24,0.0007506333468864354,24251,0.7584837206392894 355 | find-all-duplicates-in-an-array,False,22,0.0006880805679792324,24273,0.7591718012072687 356 | meeting-rooms,False,22,0.0006880805679792324,24295,0.7598598817752479 357 | find-minimum-in-rotated-sorted-array,False,22,0.0006880805679792324,24317,0.7605479623432271 358 | swap-adjacent-in-lr-string,False,22,0.0006880805679792324,24339,0.7612360429112063 359 | find-k-pairs-with-smallest-sums,False,22,0.0006880805679792324,24361,0.7619241234791856 360 | score-of-parentheses,False,22,0.0006880805679792324,24383,0.7626122040471648 361 | maximum-swap,False,22,0.0006880805679792324,24405,0.763300284615144 362 | longest-common-subsequence,False,22,0.0006880805679792324,24427,0.7639883651831233 363 | number-of-pairs-satisfying-inequality,False,21,0.000656804178525631,24448,0.764645169361649 364 | check-if-word-can-be-placed-in-crossword,False,21,0.000656804178525631,24469,0.7653019735401745 365 | jump-game-iv,False,21,0.000656804178525631,24490,0.7659587777187001 366 | count-square-submatrices-with-all-ones,False,21,0.000656804178525631,24511,0.7666155818972258 367 | largest-rectangle-in-histogram,True,21,0.000656804178525631,24532,0.7672723860757514 368 | leaf-similar-trees,False,21,0.000656804178525631,24553,0.7679291902542771 369 | read-n-characters-given-read4-ii-call-multiple-times,False,21,0.000656804178525631,24574,0.7685859944328027 370 | poor-pigs,False,21,0.000656804178525631,24595,0.7692427986113283 371 | cherry-pickup,False,21,0.000656804178525631,24616,0.7698996027898539 372 | reverse-integer,False,21,0.000656804178525631,24637,0.7705564069683796 373 | path-with-minimum-effort,False,21,0.000656804178525631,24658,0.7712132111469052 374 | the-skyline-problem,False,21,0.000656804178525631,24679,0.7718700153254309 375 | binary-tree-longest-consecutive-sequence,False,21,0.000656804178525631,24700,0.7725268195039564 376 | magnetic-force-between-two-balls,False,21,0.000656804178525631,24721,0.7731836236824821 377 | time-needed-to-inform-all-employees,False,21,0.000656804178525631,24742,0.7738404278610077 378 | subarray-sums-divisible-by-k,False,21,0.000656804178525631,24763,0.7744972320395334 379 | sort-array-by-increasing-frequency,False,21,0.000656804178525631,24784,0.775154036218059 380 | two-sum-bsts,False,21,0.000656804178525631,24805,0.7758108403965847 381 | video-stitching,False,21,0.000656804178525631,24826,0.7764676445751102 382 | number-of-operations-to-make-network-connected,False,20,0.0006255277890720296,24846,0.7770931723641823 383 | how-many-numbers-are-smaller-than-the-current-number,False,20,0.0006255277890720296,24866,0.7777187001532543 384 | minimum-absolute-difference-in-bst,False,20,0.0006255277890720296,24886,0.7783442279423264 385 | design-in-memory-file-system,False,20,0.0006255277890720296,24906,0.7789697557313984 386 | binary-tree-preorder-traversal,False,20,0.0006255277890720296,24926,0.7795952835204704 387 | implement-magic-dictionary,False,20,0.0006255277890720296,24946,0.7802208113095425 388 | 4sum-ii,False,20,0.0006255277890720296,24966,0.7808463390986145 389 | design-hashset,False,20,0.0006255277890720296,24986,0.7814718668876864 390 | count-submatrices-with-all-ones,False,20,0.0006255277890720296,25006,0.7820973946767585 391 | populating-next-right-pointers-in-each-node,False,20,0.0006255277890720296,25026,0.7827229224658305 392 | find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree,False,20,0.0006255277890720296,25046,0.7833484502549026 393 | the-maze-iii,False,20,0.0006255277890720296,25066,0.7839739780439746 394 | append-k-integers-with-minimal-sum,False,20,0.0006255277890720296,25086,0.7845995058330466 395 | permutation-in-string,False,20,0.0006255277890720296,25106,0.7852250336221187 396 | trapping-rain-water-ii,False,20,0.0006255277890720296,25126,0.7858505614111907 397 | best-time-to-buy-and-sell-stock-iii,False,20,0.0006255277890720296,25146,0.7864760892002627 398 | maximum-level-sum-of-a-binary-tree,False,20,0.0006255277890720296,25166,0.7871016169893348 399 | best-meeting-point,False,20,0.0006255277890720296,25186,0.7877271447784068 400 | find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows,False,20,0.0006255277890720296,25206,0.7883526725674788 401 | rectangle-area-ii,False,20,0.0006255277890720296,25226,0.7889782003565509 402 | divisor-game,False,20,0.0006255277890720296,25246,0.7896037281456229 403 | divide-two-integers,False,20,0.0006255277890720296,25266,0.790229255934695 404 | clone-graph,True,20,0.0006255277890720296,25286,0.7908547837237669 405 | basic-calculator-iv,False,20,0.0006255277890720296,25306,0.7914803115128389 406 | flipping-an-image,False,20,0.0006255277890720296,25326,0.792105839301911 407 | max-value-of-equation,False,20,0.0006255277890720296,25346,0.792731367090983 408 | minimum-space-wasted-from-packaging,False,20,0.0006255277890720296,25366,0.793356894880055 409 | flatten-2d-vector,False,20,0.0006255277890720296,25386,0.7939824226691271 410 | first-unique-number,False,20,0.0006255277890720296,25406,0.7946079504581991 411 | number-of-1-bits,False,20,0.0006255277890720296,25426,0.7952334782472711 412 | find-the-shortest-superstring,False,20,0.0006255277890720296,25446,0.7958590060363432 413 | longest-mountain-in-array,False,20,0.0006255277890720296,25466,0.7964845338254152 414 | minimum-rounds-to-complete-all-tasks,False,20,0.0006255277890720296,25486,0.7971100616144873 415 | binary-tree-paths,False,20,0.0006255277890720296,25506,0.7977355894035593 416 | pancake-sorting,False,20,0.0006255277890720296,25526,0.7983611171926313 417 | max-chunks-to-make-sorted,False,20,0.0006255277890720296,25546,0.7989866449817034 418 | graph-valid-tree,False,20,0.0006255277890720296,25566,0.7996121727707753 419 | design-snake-game,False,20,0.0006255277890720296,25586,0.8002377005598473 420 | number-of-connected-components-in-an-undirected-graph,False,20,0.0006255277890720296,25606,0.8008632283489194 421 | redundant-connection,False,20,0.0006255277890720296,25626,0.8014887561379914 422 | number-of-ways-to-reorder-array-to-get-same-bst,False,20,0.0006255277890720296,25646,0.8021142839270634 423 | number-of-closed-islands,False,20,0.0006255277890720296,25666,0.8027398117161355 424 | convert-bst-to-greater-tree,False,20,0.0006255277890720296,25686,0.8033653395052075 425 | maximum-white-tiles-covered-by-a-carpet,False,20,0.0006255277890720296,25706,0.8039908672942796 426 | pour-water,False,20,0.0006255277890720296,25726,0.8046163950833516 427 | add-two-integers,False,19,0.000594251399618428,25745,0.80521064648297 428 | maximum-score-words-formed-by-letters,False,18,0.0005629750101648266,25763,0.8057736214931348 429 | richest-customer-wealth,False,18,0.0005629750101648266,25781,0.8063365965032997 430 | rank-transform-of-a-matrix,False,18,0.0005629750101648266,25799,0.8068995715134645 431 | maximum-binary-tree,False,18,0.0005629750101648266,25817,0.8074625465236294 432 | strobogrammatic-number-ii,False,18,0.0005629750101648266,25835,0.8080255215337941 433 | add-strings,False,18,0.0005629750101648266,25853,0.8085884965439589 434 | expressive-words,False,18,0.0005629750101648266,25871,0.8091514715541238 435 | critical-connections-in-a-network,False,18,0.0005629750101648266,25889,0.8097144465642886 436 | rank-transform-of-an-array,False,18,0.0005629750101648266,25907,0.8102774215744535 437 | the-maze,False,18,0.0005629750101648266,25925,0.8108403965846183 438 | rotate-list,False,18,0.0005629750101648266,25943,0.8114033715947832 439 | reverse-vowels-of-a-string,False,18,0.0005629750101648266,25961,0.8119663466049479 440 | reverse-string,False,18,0.0005629750101648266,25979,0.8125293216151127 441 | repeated-dna-sequences,False,18,0.0005629750101648266,25997,0.8130922966252776 442 | beautiful-array,False,18,0.0005629750101648266,26015,0.8136552716354424 443 | walls-and-gates,False,18,0.0005629750101648266,26033,0.8142182466456073 444 | maximum-number-of-events-that-can-be-attended-ii,False,18,0.0005629750101648266,26051,0.814781221655772 445 | path-sum-iii,False,18,0.0005629750101648266,26069,0.8153441966659369 446 | valid-tic-tac-toe-state,False,18,0.0005629750101648266,26087,0.8159071716761017 447 | verifying-an-alien-dictionary,False,18,0.0005629750101648266,26105,0.8164701466862665 448 | construct-binary-search-tree-from-preorder-traversal,False,18,0.0005629750101648266,26123,0.8170331216964314 449 | shopping-offers,False,18,0.0005629750101648266,26141,0.8175960967065962 450 | bus-routes,False,18,0.0005629750101648266,26159,0.818159071716761 451 | cat-and-mouse,False,18,0.0005629750101648266,26177,0.8187220467269258 452 | shuffle-an-array,False,18,0.0005629750101648266,26195,0.8192850217370907 453 | rearrange-string-k-distance-apart,False,18,0.0005629750101648266,26213,0.8198479967472555 454 | find-good-days-to-rob-the-bank,False,18,0.0005629750101648266,26231,0.8204109717574203 455 | number-of-boomerangs,False,18,0.0005629750101648266,26249,0.8209739467675852 456 | smallest-common-region,False,18,0.0005629750101648266,26267,0.82153692177775 457 | encode-and-decode-strings,False,18,0.0005629750101648266,26285,0.8220998967879148 458 | bitwise-ors-of-subarrays,False,18,0.0005629750101648266,26303,0.8226628717980796 459 | stickers-to-spell-word,False,18,0.0005629750101648266,26321,0.8232258468082445 460 | string-to-integer-atoi,True,17,0.0005316986207112251,26338,0.8237575454289556 461 | tiling-a-rectangle-with-the-fewest-squares,False,16,0.0005004222312576237,26354,0.8242579676602133 462 | regions-cut-by-slashes,False,16,0.0005004222312576237,26370,0.8247583898914709 463 | checking-existence-of-edge-length-limited-paths,False,16,0.0005004222312576237,26386,0.8252588121227286 464 | boats-to-save-people,False,16,0.0005004222312576237,26402,0.8257592343539861 465 | distinct-subsequences-ii,False,16,0.0005004222312576237,26418,0.8262596565852438 466 | minimum-height-trees,True,16,0.0005004222312576237,26434,0.8267600788165014 467 | fibonacci-number,False,16,0.0005004222312576237,26450,0.8272605010477591 468 | sliding-window-median,False,16,0.0005004222312576237,26466,0.8277609232790166 469 | redundant-connection-ii,False,16,0.0005004222312576237,26482,0.8282613455102743 470 | amount-of-time-for-binary-tree-to-be-infected,False,16,0.0005004222312576237,26498,0.8287617677415319 471 | number-of-ways-to-build-sturdy-brick-wall,False,16,0.0005004222312576237,26514,0.8292621899727896 472 | remove-all-ones-with-row-and-column-flips,False,16,0.0005004222312576237,26530,0.8297626122040471 473 | minimum-number-of-swaps-to-make-the-string-balanced,False,16,0.0005004222312576237,26546,0.8302630344353048 474 | count-good-nodes-in-binary-tree,False,16,0.0005004222312576237,26562,0.8307634566665624 475 | valid-palindrome-iii,False,16,0.0005004222312576237,26578,0.83126387889782 476 | the-most-similar-path-in-a-graph,False,16,0.0005004222312576237,26594,0.8317643011290776 477 | cat-and-mouse-ii,False,16,0.0005004222312576237,26610,0.8322647233603353 478 | maximum-number-of-points-with-cost,False,16,0.0005004222312576237,26626,0.8327651455915929 479 | wiggle-sort-ii,False,16,0.0005004222312576237,26642,0.8332655678228506 480 | remove-k-digits,False,16,0.0005004222312576237,26658,0.8337659900541081 481 | split-bst,False,16,0.0005004222312576237,26674,0.8342664122853658 482 | maximum-length-of-a-concatenated-string-with-unique-characters,False,16,0.0005004222312576237,26690,0.8347668345166234 483 | intersection-of-three-sorted-arrays,False,16,0.0005004222312576237,26706,0.835267256747881 484 | string-compression,False,16,0.0005004222312576237,26722,0.8357676789791386 485 | sqrtx,False,16,0.0005004222312576237,26738,0.8362681012103963 486 | web-crawler,False,16,0.0005004222312576237,26754,0.8367685234416539 487 | search-a-2d-matrix-ii,False,16,0.0005004222312576237,26770,0.8372689456729115 488 | maximum-split-of-positive-even-integers,False,15,0.00046914584180402213,26785,0.8377380915147156 489 | closest-binary-search-tree-value,False,15,0.00046914584180402213,26800,0.8382072373565196 490 | count-sub-islands,False,15,0.00046914584180402213,26815,0.8386763831983236 491 | random-pick-with-blacklist,False,15,0.00046914584180402213,26830,0.8391455290401276 492 | max-stack,False,15,0.00046914584180402213,26845,0.8396146748819316 493 | max-chunks-to-make-sorted-ii,False,15,0.00046914584180402213,26860,0.8400838207237357 494 | maximum-score-of-a-good-subarray,False,15,0.00046914584180402213,26875,0.8405529665655397 495 | count-number-of-teams,False,15,0.00046914584180402213,26890,0.8410221124073437 496 | matrix-block-sum,False,15,0.00046914584180402213,26905,0.8414912582491477 497 | maximum-number-of-visible-points,False,15,0.00046914584180402213,26920,0.8419604040909517 498 | brace-expansion,False,15,0.00046914584180402213,26935,0.8424295499327558 499 | lowest-common-ancestor-of-deepest-leaves,False,15,0.00046914584180402213,26950,0.8428986957745598 500 | maximum-path-quality-of-a-graph,False,15,0.00046914584180402213,26965,0.8433678416163638 501 | design-excel-sum-formula,False,15,0.00046914584180402213,26980,0.8438369874581678 502 | longest-string-chain,False,15,0.00046914584180402213,26995,0.8443061332999718 503 | minimum-number-of-taps-to-open-to-water-a-garden,False,15,0.00046914584180402213,27010,0.8447752791417759 504 | maximum-sum-bst-in-binary-tree,False,15,0.00046914584180402213,27025,0.8452444249835799 505 | minimum-distance-between-bst-nodes,False,15,0.00046914584180402213,27040,0.8457135708253839 506 | convert-sorted-array-to-binary-search-tree,False,15,0.00046914584180402213,27055,0.8461827166671879 507 | minimum-interval-to-include-each-query,False,15,0.00046914584180402213,27070,0.8466518625089919 508 | pairs-of-songs-with-total-durations-divisible-by-60,False,15,0.00046914584180402213,27085,0.847121008350796 509 | fraction-to-recurring-decimal,False,15,0.00046914584180402213,27100,0.8475901541926 510 | flatten-a-multilevel-doubly-linked-list,False,15,0.00046914584180402213,27115,0.848059300034404 511 | fizz-buzz,False,15,0.00046914584180402213,27130,0.848528445876208 512 | distribute-coins-in-binary-tree,False,15,0.00046914584180402213,27145,0.848997591718012 513 | design-front-middle-back-queue,False,15,0.00046914584180402213,27160,0.849466737559816 514 | finding-mk-average,False,15,0.00046914584180402213,27175,0.8499358834016201 515 | online-majority-element-in-subarray,False,15,0.00046914584180402213,27190,0.8504050292434241 516 | minimum-window-subsequence,False,15,0.00046914584180402213,27205,0.8508741750852281 517 | find-minimum-time-to-finish-all-jobs,False,15,0.00046914584180402213,27220,0.8513433209270321 518 | check-completeness-of-a-binary-tree,False,15,0.00046914584180402213,27235,0.8518124667688362 519 | stream-of-characters,False,15,0.00046914584180402213,27250,0.8522816126106403 520 | x-of-a-kind-in-a-deck-of-cards,False,15,0.00046914584180402213,27265,0.8527507584524443 521 | find-all-anagrams-in-a-string,True,15,0.00046914584180402213,27280,0.8532199042942483 522 | shortest-subarray-to-be-removed-to-make-array-sorted,False,15,0.00046914584180402213,27295,0.8536890501360523 523 | minimum-deletions-to-make-character-frequencies-unique,False,15,0.00046914584180402213,27310,0.8541581959778564 524 | keys-and-rooms,False,15,0.00046914584180402213,27325,0.8546273418196604 525 | synonymous-sentences,False,15,0.00046914584180402213,27340,0.8550964876614644 526 | predict-the-winner,False,15,0.00046914584180402213,27355,0.8555656335032684 527 | longest-palindrome,True,15,0.00046914584180402213,27370,0.8560347793450724 528 | add-two-numbers-ii,False,15,0.00046914584180402213,27385,0.8565039251868765 529 | power-of-two,False,15,0.00046914584180402213,27400,0.8569730710286805 530 | baseball-game,False,15,0.00046914584180402213,27415,0.8574422168704845 531 | binary-tree-level-order-traversal-ii,False,15,0.00046914584180402213,27430,0.8579113627122885 532 | delete-leaves-with-a-given-value,False,15,0.00046914584180402213,27445,0.8583805085540925 533 | kill-process,False,15,0.00046914584180402213,27460,0.8588496543958966 534 | inorder-successor-in-bst-ii,False,15,0.00046914584180402213,27475,0.8593188002377006 535 | rank-teams-by-votes,False,15,0.00046914584180402213,27490,0.8597879460795046 536 | perfect-squares,False,15,0.00046914584180402213,27505,0.8602570919213086 537 | k-diff-pairs-in-an-array,False,15,0.00046914584180402213,27520,0.8607262377631126 538 | design-compressed-string-iterator,False,15,0.00046914584180402213,27535,0.8611953836049167 539 | path-with-maximum-probability,False,15,0.00046914584180402213,27550,0.8616645294467207 540 | swapping-nodes-in-a-linked-list,False,14,0.00043786945235042065,27564,0.8621023988990711 541 | subarray-product-less-than-k,False,14,0.00043786945235042065,27578,0.8625402683514215 542 | compare-version-numbers,False,14,0.00043786945235042065,27592,0.862978137803772 543 | shortest-subarray-with-sum-at-least-k,False,14,0.00043786945235042065,27606,0.8634160072561223 544 | corporate-flight-bookings,False,14,0.00043786945235042065,27620,0.8638538767084728 545 | reverse-words-in-a-string,False,14,0.00043786945235042065,27634,0.8642917461608232 546 | reverse-pairs,False,14,0.00043786945235042065,27648,0.8647296156131736 547 | partition-array-for-maximum-sum,False,14,0.00043786945235042065,27662,0.865167485065524 548 | valid-number,False,14,0.00043786945235042065,27676,0.8656053545178745 549 | minimum-domino-rotations-for-equal-row,False,14,0.00043786945235042065,27690,0.8660432239702249 550 | guess-number-higher-or-lower,False,14,0.00043786945235042065,27704,0.8664810934225753 551 | greatest-common-divisor-of-strings,False,14,0.00043786945235042065,27718,0.8669189628749258 552 | increasing-triplet-subsequence,False,14,0.00043786945235042065,27732,0.8673568323272761 553 | combinations,False,13,0.00040659306289681917,27745,0.8677634253901729 554 | summary-ranges,False,13,0.00040659306289681917,27758,0.8681700184530697 555 | maximum-element-after-decreasing-and-rearranging,False,12,0.0003753166734432177,27770,0.868545335126513 556 | maximum-font-to-fit-a-sentence-in-a-screen,False,12,0.0003753166734432177,27782,0.8689206517999563 557 | ways-to-split-array-into-three-subarrays,False,12,0.0003753166734432177,27794,0.8692959684733994 558 | path-in-zigzag-labelled-binary-tree,False,12,0.0003753166734432177,27806,0.8696712851468427 559 | design-most-recently-used-queue,False,12,0.0003753166734432177,27818,0.8700466018202858 560 | minimum-depth-of-binary-tree,False,12,0.0003753166734432177,27830,0.8704219184937291 561 | find-root-of-n-ary-tree,False,12,0.0003753166734432177,27842,0.8707972351671723 562 | sort-the-matrix-diagonally,False,12,0.0003753166734432177,27854,0.8711725518406155 563 | find-positive-integer-solution-for-a-given-equation,False,12,0.0003753166734432177,27866,0.8715478685140587 564 | shortest-completing-word,False,12,0.0003753166734432177,27878,0.871923185187502 565 | short-encoding-of-words,False,12,0.0003753166734432177,27890,0.8722985018609452 566 | peak-index-in-a-mountain-array,False,12,0.0003753166734432177,27902,0.8726738185343884 567 | peeking-iterator,False,12,0.0003753166734432177,27914,0.8730491352078316 568 | split-array-into-consecutive-subsequences,False,12,0.0003753166734432177,27926,0.8734244518812748 569 | intersection-of-two-linked-lists,False,12,0.0003753166734432177,27938,0.8737997685547181 570 | missing-ranges,False,12,0.0003753166734432177,27950,0.8741750852281612 571 | number-of-smooth-descent-periods-of-a-stock,False,12,0.0003753166734432177,27962,0.8745504019016045 572 | sell-diminishing-valued-colored-balls,False,12,0.0003753166734432177,27974,0.8749257185750478 573 | finding-the-number-of-visible-mountains,False,12,0.0003753166734432177,27986,0.8753010352484909 574 | valid-perfect-square,False,12,0.0003753166734432177,27998,0.8756763519219342 575 | minesweeper,False,12,0.0003753166734432177,28010,0.8760516685953773 576 | second-minimum-node-in-a-binary-tree,False,12,0.0003753166734432177,28022,0.8764269852688206 577 | surface-area-of-3d-shapes,False,12,0.0003753166734432177,28034,0.8768023019422638 578 | super-ugly-number,False,12,0.0003753166734432177,28046,0.877177618615707 579 | constrained-subsequence-sum,False,12,0.0003753166734432177,28058,0.8775529352891502 580 | greatest-sum-divisible-by-three,False,12,0.0003753166734432177,28070,0.8779282519625934 581 | sum-of-root-to-leaf-binary-numbers,False,12,0.0003753166734432177,28082,0.8783035686360366 582 | car-fleet,False,12,0.0003753166734432177,28094,0.8786788853094799 583 | find-words-that-can-be-formed-by-characters,False,12,0.0003753166734432177,28106,0.8790542019829231 584 | diameter-of-n-ary-tree,False,12,0.0003753166734432177,28118,0.8794295186563663 585 | contiguous-array,False,12,0.0003753166734432177,28130,0.8798048353298096 586 | smallest-number-in-infinite-set,False,12,0.0003753166734432177,28142,0.8801801520032527 587 | friends-of-appropriate-ages,False,12,0.0003753166734432177,28154,0.880555468676696 588 | palindrome-permutation-ii,False,12,0.0003753166734432177,28166,0.8809307853501391 589 | solve-the-equation,False,12,0.0003753166734432177,28178,0.8813061020235824 590 | divide-intervals-into-minimum-number-of-groups,False,12,0.0003753166734432177,28190,0.8816814186970257 591 | parse-lisp-expression,False,12,0.0003753166734432177,28202,0.8820567353704688 592 | sum-of-nodes-with-even-valued-grandparent,False,12,0.0003753166734432177,28214,0.8824320520439121 593 | diagonal-traverse,False,12,0.0003753166734432177,28226,0.8828073687173553 594 | ones-and-zeroes,False,12,0.0003753166734432177,28238,0.8831826853907985 595 | minimum-jumps-to-reach-home,False,12,0.0003753166734432177,28250,0.8835580020642417 596 | game-of-life,False,12,0.0003753166734432177,28262,0.8839333187376849 597 | minimum-insertion-steps-to-make-a-string-palindrome,False,12,0.0003753166734432177,28274,0.8843086354111281 598 | global-and-local-inversions,False,12,0.0003753166734432177,28286,0.8846839520845714 599 | gray-code,False,12,0.0003753166734432177,28298,0.8850592687580146 600 | jump-game-v,False,12,0.0003753166734432177,28310,0.8854345854314578 601 | minimize-hamming-distance-after-swap-operations,False,12,0.0003753166734432177,28322,0.885809902104901 602 | unique-morse-code-words,False,12,0.0003753166734432177,28334,0.8861852187783442 603 | make-two-arrays-equal-by-reversing-subarrays,False,12,0.0003753166734432177,28346,0.8865605354517875 604 | total-hamming-distance,False,12,0.0003753166734432177,28358,0.8869358521252306 605 | array-of-doubled-pairs,False,12,0.0003753166734432177,28370,0.8873111687986739 606 | reorder-routes-to-make-all-paths-lead-to-the-city-zero,False,12,0.0003753166734432177,28382,0.8876864854721171 607 | reorder-list,False,12,0.0003753166734432177,28394,0.8880618021455603 608 | new-21-game,False,12,0.0003753166734432177,28406,0.8884371188190036 609 | balance-a-binary-search-tree,False,12,0.0003753166734432177,28418,0.8888124354924467 610 | remove-element,False,12,0.0003753166734432177,28430,0.88918775216589 611 | push-dominoes,False,12,0.0003753166734432177,28442,0.8895630688393332 612 | word-squares,False,12,0.0003753166734432177,28454,0.8899383855127764 613 | making-file-names-unique,False,12,0.0003753166734432177,28466,0.8903137021862196 614 | longest-repeating-substring,False,12,0.0003753166734432177,28478,0.8906890188596629 615 | random-pick-index,False,12,0.0003753166734432177,28490,0.891064335533106 616 | relative-sort-array,False,12,0.0003753166734432177,28502,0.8914396522065493 617 | find-a-peak-element-ii,False,12,0.0003753166734432177,28514,0.8918149688799925 618 | find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree,False,12,0.0003753166734432177,28526,0.8921902855534357 619 | rearrange-characters-to-make-target-string,False,12,0.0003753166734432177,28538,0.892565602226879 620 | non-overlapping-intervals,False,12,0.0003753166734432177,28550,0.8929409189003221 621 | number-of-digit-one,False,12,0.0003753166734432177,28562,0.8933162355737654 622 | strings-differ-by-one-character,False,12,0.0003753166734432177,28574,0.8936915522472085 623 | fair-candy-swap,False,12,0.0003753166734432177,28586,0.8940668689206518 624 | longest-substring-with-at-least-k-repeating-characters,False,12,0.0003753166734432177,28598,0.894442185594095 625 | minimum-operations-to-make-a-uni-value-grid,False,12,0.0003753166734432177,28610,0.8948175022675382 626 | rings-and-rods,False,12,0.0003753166734432177,28622,0.8951928189409815 627 | print-immutable-linked-list-in-reverse,False,12,0.0003753166734432177,28634,0.8955681356144247 628 | subsets-ii,False,12,0.0003753166734432177,28646,0.8959434522878679 629 | allocate-mailboxes,False,12,0.0003753166734432177,28658,0.8963187689613111 630 | find-duplicate-file-in-system,False,12,0.0003753166734432177,28670,0.8966940856347543 631 | stone-game,False,12,0.0003753166734432177,28682,0.8970694023081975 632 | find-common-characters,False,12,0.0003753166734432177,28694,0.8974447189816408 633 | n-th-tribonacci-number,False,12,0.0003753166734432177,28706,0.897820035655084 634 | n-queens,False,12,0.0003753166734432177,28718,0.8981953523285272 635 | binary-tree-longest-consecutive-sequence-ii,False,12,0.0003753166734432177,28730,0.8985706690019705 636 | stone-game-ii,False,12,0.0003753166734432177,28742,0.8989459856754136 637 | longest-absolute-file-path,False,12,0.0003753166734432177,28754,0.8993213023488569 638 | reverse-linked-list-ii,False,12,0.0003753166734432177,28766,0.8996966190223 639 | my-calendar-ii,False,12,0.0003753166734432177,28778,0.9000719356957433 640 | angle-between-hands-of-a-clock,False,11,0.0003440402839896162,28789,0.9004159759797329 641 | number-of-enclaves,False,10,0.0003127638945360148,28799,0.9007287398742689 642 | minimum-swaps-to-make-sequences-increasing,False,10,0.0003127638945360148,28809,0.9010415037688049 643 | number-of-restricted-paths-from-first-to-last-node,False,10,0.0003127638945360148,28819,0.9013542676633409 644 | find-the-winner-of-the-circular-game,False,10,0.0003127638945360148,28829,0.901667031557877 645 | substrings-that-begin-and-end-with-the-same-letter,False,10,0.0003127638945360148,28839,0.901979795452413 646 | contain-virus,False,10,0.0003127638945360148,28849,0.902292559346949 647 | divide-chocolate,False,10,0.0003127638945360148,28859,0.902605323241485 648 | find-distance-in-a-binary-tree,False,10,0.0003127638945360148,28869,0.9029180871360211 649 | number-of-unique-good-subsequences,False,10,0.0003127638945360148,28879,0.903230851030557 650 | sum-of-all-subset-xor-totals,False,10,0.0003127638945360148,28889,0.903543614925093 651 | string-transforms-into-another-string,False,10,0.0003127638945360148,28899,0.9038563788196291 652 | combination-sum-iv,False,10,0.0003127638945360148,28909,0.904169142714165 653 | find-all-people-with-secret,False,10,0.0003127638945360148,28919,0.9044819066087011 654 | next-closest-time,False,10,0.0003127638945360148,28929,0.9047946705032371 655 | egg-drop-with-2-eggs-and-n-floors,False,10,0.0003127638945360148,28939,0.9051074343977731 656 | 132-pattern,False,10,0.0003127638945360148,28949,0.9054201982923091 657 | construct-binary-tree-from-inorder-and-postorder-traversal,False,10,0.0003127638945360148,28959,0.9057329621868452 658 | numbers-at-most-n-given-digit-set,False,10,0.0003127638945360148,28969,0.9060457260813811 659 | split-array-with-equal-sum,False,10,0.0003127638945360148,28979,0.9063584899759172 660 | guess-the-word,False,10,0.0003127638945360148,28989,0.9066712538704532 661 | car-fleet-ii,False,10,0.0003127638945360148,28999,0.9069840177649892 662 | delete-duplicate-folders-in-system,False,10,0.0003127638945360148,29009,0.9072967816595252 663 | smallest-rectangle-enclosing-black-pixels,False,10,0.0003127638945360148,29019,0.9076095455540613 664 | least-number-of-unique-integers-after-k-removals,False,10,0.0003127638945360148,29029,0.9079223094485973 665 | third-maximum-number,False,10,0.0003127638945360148,29039,0.9082350733431332 666 | clone-binary-tree-with-random-pointer,False,10,0.0003127638945360148,29049,0.9085478372376693 667 | longest-common-subpath,False,10,0.0003127638945360148,29059,0.9088606011322053 668 | restore-ip-addresses,False,10,0.0003127638945360148,29069,0.9091733650267413 669 | toeplitz-matrix,False,10,0.0003127638945360148,29079,0.9094861289212773 670 | repeated-substring-pattern,False,10,0.0003127638945360148,29089,0.9097988928158134 671 | process-restricted-friend-requests,False,10,0.0003127638945360148,29099,0.9101116567103493 672 | longest-well-performing-interval,False,10,0.0003127638945360148,29109,0.9104244206048854 673 | remove-covered-intervals,False,10,0.0003127638945360148,29119,0.9107371844994214 674 | queue-reconstruction-by-height,False,10,0.0003127638945360148,29129,0.9110499483939574 675 | bold-words-in-string,False,10,0.0003127638945360148,29139,0.9113627122884934 676 | matchsticks-to-square,False,10,0.0003127638945360148,29149,0.9116754761830295 677 | couples-holding-hands,False,10,0.0003127638945360148,29159,0.9119882400775654 678 | unique-binary-search-trees-ii,False,10,0.0003127638945360148,29169,0.9123010039721015 679 | unique-binary-search-trees,False,10,0.0003127638945360148,29179,0.9126137678666375 680 | counting-words-with-a-given-prefix,False,10,0.0003127638945360148,29189,0.9129265317611734 681 | uncommon-words-from-two-sentences,False,10,0.0003127638945360148,29199,0.9132392956557095 682 | largest-bst-subtree,False,10,0.0003127638945360148,29209,0.9135520595502455 683 | merge-bsts-to-create-single-bst,False,10,0.0003127638945360148,29219,0.9138648234447815 684 | increasing-order-search-tree,False,10,0.0003127638945360148,29229,0.9141775873393175 685 | minimum-cost-to-set-cooking-time,False,10,0.0003127638945360148,29239,0.9144903512338536 686 | contains-duplicate-iii,False,10,0.0003127638945360148,29249,0.9148031151283896 687 | frog-jump,False,10,0.0003127638945360148,29259,0.9151158790229256 688 | minimum-number-of-days-to-eat-n-oranges,False,10,0.0003127638945360148,29269,0.9154286429174616 689 | parallel-courses,False,10,0.0003127638945360148,29279,0.9157414068119977 690 | minimum-knight-moves,False,10,0.0003127638945360148,29289,0.9160541707065336 691 | single-number-ii,False,10,0.0003127638945360148,29299,0.9163669346010697 692 | design-phone-directory,False,10,0.0003127638945360148,29309,0.9166796984956057 693 | shortest-word-distance-ii,False,10,0.0003127638945360148,29319,0.9169924623901416 694 | check-if-n-and-its-double-exist,False,10,0.0003127638945360148,29329,0.9173052262846777 695 | minimum-cost-to-cut-a-stick,False,10,0.0003127638945360148,29339,0.9176179901792137 696 | valid-square,False,10,0.0003127638945360148,29349,0.9179307540737497 697 | delete-operation-for-two-strings,False,10,0.0003127638945360148,29359,0.9182435179682857 698 | shifting-letters,False,10,0.0003127638945360148,29369,0.9185562818628218 699 | design-an-expression-tree-with-evaluate-function,False,10,0.0003127638945360148,29379,0.9188690457573577 700 | swap-nodes-in-pairs,False,10,0.0003127638945360148,29389,0.9191818096518938 701 | shortest-distance-from-all-buildings,False,9,0.0002814875050824133,29398,0.9194632971569762 702 | parsing-a-boolean-expression,False,9,0.0002814875050824133,29407,0.9197447846620586 703 | student-attendance-record-ii,False,9,0.0002814875050824133,29416,0.9200262721671411 704 | rotate-function,False,9,0.0002814875050824133,29425,0.9203077596722234 705 | robot-bounded-in-circle,False,9,0.0002814875050824133,29434,0.9205892471773058 706 | add-digits,False,9,0.0002814875050824133,29443,0.9208707346823882 707 | valid-sudoku,False,9,0.0002814875050824133,29452,0.9211522221874707 708 | sequence-reconstruction,False,9,0.0002814875050824133,29461,0.9214337096925531 709 | queens-that-can-attack-the-king,False,9,0.0002814875050824133,29470,0.9217151971976355 710 | transpose-matrix,False,9,0.0002814875050824133,29479,0.9219966847027179 711 | sum-of-all-odd-length-subarrays,False,9,0.0002814875050824133,29488,0.9222781722078003 712 | search-in-a-sorted-array-of-unknown-size,False,9,0.0002814875050824133,29497,0.9225596597128828 713 | best-time-to-buy-and-sell-stock-with-transaction-fee,False,9,0.0002814875050824133,29506,0.9228411472179652 714 | find-right-interval,False,9,0.0002814875050824133,29515,0.9231226347230476 715 | increasing-decreasing-string,False,9,0.0002814875050824133,29524,0.92340412222813 716 | count-univalue-subtrees,False,9,0.0002814875050824133,29533,0.9236856097332123 717 | binary-tree-pruning,False,9,0.0002814875050824133,29542,0.9239670972382948 718 | minimum-replacements-to-sort-the-array,False,9,0.0002814875050824133,29551,0.9242485847433772 719 | maximum-difference-between-node-and-ancestor,False,9,0.0002814875050824133,29560,0.9245300722484596 720 | cracking-the-safe,False,9,0.0002814875050824133,29569,0.924811559753542 721 | flip-equivalent-binary-trees,False,9,0.0002814875050824133,29578,0.9250930472586245 722 | maximum-number-of-events-that-can-be-attended,False,9,0.0002814875050824133,29587,0.9253745347637069 723 | count-negative-numbers-in-a-sorted-matrix,False,9,0.0002814875050824133,29596,0.9256560222687893 724 | count-integers-in-intervals,False,9,0.0002814875050824133,29605,0.9259375097738717 725 | maximum-number-of-occurrences-of-a-substring,False,9,0.0002814875050824133,29614,0.9262189972789541 726 | bomb-enemy,False,9,0.0002814875050824133,29623,0.9265004847840366 727 | flower-planting-with-no-adjacent,False,9,0.0002814875050824133,29632,0.926781972289119 728 | maximum-product-of-three-numbers,False,9,0.0002814875050824133,29641,0.9270634597942013 729 | minimum-falling-path-sum,False,9,0.0002814875050824133,29650,0.9273449472992837 730 | minimum-genetic-mutation,False,9,0.0002814875050824133,29659,0.9276264348043661 731 | cells-with-odd-values-in-a-matrix,False,9,0.0002814875050824133,29668,0.9279079223094486 732 | minimum-difference-in-sums-after-removal-of-elements,False,9,0.0002814875050824133,29677,0.928189409814531 733 | concatenation-of-consecutive-binary-numbers,False,9,0.0002814875050824133,29686,0.9284708973196134 734 | delete-node-in-a-linked-list,False,9,0.0002814875050824133,29695,0.9287523848246958 735 | largest-number,False,9,0.0002814875050824133,29704,0.9290338723297783 736 | minimum-cost-to-move-chips-to-the-same-position,False,9,0.0002814875050824133,29713,0.9293153598348607 737 | minimum-cost-to-connect-sticks,False,9,0.0002814875050824133,29722,0.9295968473399431 738 | longest-arithmetic-subsequence-of-given-difference,False,9,0.0002814875050824133,29731,0.9298783348450255 739 | maximum-length-of-pair-chain,False,8,0.00025021111562881183,29739,0.9301285459606543 740 | find-k-th-smallest-pair-distance,False,8,0.00025021111562881183,29747,0.9303787570762831 741 | find-if-path-exists-in-graph,False,8,0.00025021111562881183,29755,0.9306289681919119 742 | check-if-an-original-string-exists-given-two-encoded-strings,False,8,0.00025021111562881183,29763,0.9308791793075407 743 | minimize-deviation-in-array,False,8,0.00025021111562881183,29771,0.9311293904231696 744 | maximum-distance-between-a-pair-of-values,False,8,0.00025021111562881183,29779,0.9313796015387984 745 | divide-array-in-sets-of-k-consecutive-numbers,False,8,0.00025021111562881183,29787,0.9316298126544271 746 | maximum-frequency-stack,False,8,0.00025021111562881183,29795,0.931880023770056 747 | find-all-numbers-disappeared-in-an-array,False,8,0.00025021111562881183,29803,0.9321302348856848 748 | stone-game-iii,False,8,0.00025021111562881183,29811,0.9323804460013136 749 | stone-game-v,False,8,0.00025021111562881183,29819,0.9326306571169424 750 | maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold,False,8,0.00025021111562881183,29827,0.9328808682325712 751 | possible-bipartition,False,8,0.00025021111562881183,29835,0.9331310793482 752 | all-oone-data-structure,False,8,0.00025021111562881183,29843,0.9333812904638289 753 | prefix-and-suffix-search,False,8,0.00025021111562881183,29851,0.9336315015794576 754 | print-binary-tree,False,8,0.00025021111562881183,29859,0.9338817126950865 755 | backspace-string-compare,False,8,0.00025021111562881183,29867,0.9341319238107153 756 | find-largest-value-in-each-tree-row,False,8,0.00025021111562881183,29875,0.9343821349263441 757 | find-bottom-left-tree-value,False,8,0.00025021111562881183,29883,0.9346323460419729 758 | all-paths-from-source-to-target,False,8,0.00025021111562881183,29891,0.9348825571576017 759 | stone-game-vii,False,8,0.00025021111562881183,29899,0.9351327682732306 760 | zigzag-iterator,False,8,0.00025021111562881183,29907,0.9353829793888594 761 | maximize-the-confusion-of-an-exam,False,8,0.00025021111562881183,29915,0.9356331905044881 762 | single-number,False,8,0.00025021111562881183,29923,0.935883401620117 763 | rotate-string,False,8,0.00025021111562881183,29931,0.9361336127357458 764 | k-radius-subarray-averages,False,8,0.00025021111562881183,29939,0.9363838238513746 765 | nth-magical-number,False,8,0.00025021111562881183,29947,0.9366340349670034 766 | reveal-cards-in-increasing-order,False,8,0.00025021111562881183,29955,0.9368842460826322 767 | iterator-for-combination,False,8,0.00025021111562881183,29963,0.937134457198261 768 | ipo,False,8,0.00025021111562881183,29971,0.9373846683138899 769 | invalid-transactions,False,8,0.00025021111562881183,29979,0.9376348794295186 770 | integer-replacement,False,8,0.00025021111562881183,29987,0.9378850905451475 771 | reordered-power-of-2,False,8,0.00025021111562881183,29995,0.9381353016607763 772 | camelcase-matching,False,8,0.00025021111562881183,30003,0.9383855127764051 773 | brace-expansion-ii,False,8,0.00025021111562881183,30011,0.9386357238920339 774 | shortest-path-in-a-hidden-grid,False,8,0.00025021111562881183,30019,0.9388859350076627 775 | increasing-subsequences,False,8,0.00025021111562881183,30027,0.9391361461232915 776 | shortest-word-distance,False,8,0.00025021111562881183,30035,0.9393863572389204 777 | lowest-common-ancestor-of-a-binary-search-tree,True,8,0.00025021111562881183,30043,0.9396365683545491 778 | recover-a-tree-from-preorder-traversal,False,8,0.00025021111562881183,30051,0.939886779470178 779 | remove-duplicates-from-sorted-array-ii,False,8,0.00025021111562881183,30059,0.9401369905858068 780 | remove-duplicate-letters,False,8,0.00025021111562881183,30067,0.9403872017014356 781 | candy-crush,False,8,0.00025021111562881183,30075,0.9406374128170644 782 | remove-all-ones-with-row-and-column-flips-ii,False,8,0.00025021111562881183,30083,0.9408876239326932 783 | smallest-sufficient-team,False,8,0.00025021111562881183,30091,0.941137835048322 784 | remove-all-adjacent-duplicates-in-string-ii,False,8,0.00025021111562881183,30099,0.9413880461639509 785 | map-sum-pairs,False,8,0.00025021111562881183,30107,0.9416382572795796 786 | find-the-smallest-divisor-given-a-threshold,False,8,0.00025021111562881183,30115,0.9418884683952085 787 | find-the-most-competitive-subsequence,False,8,0.00025021111562881183,30123,0.9421386795108373 788 | sort-features-by-popularity,False,8,0.00025021111562881183,30131,0.9423888906264661 789 | find-the-celebrity,False,8,0.00025021111562881183,30139,0.9426391017420949 790 | sort-items-by-groups-respecting-dependencies,False,8,0.00025021111562881183,30147,0.9428893128577237 791 | permutations-ii,False,8,0.00025021111562881183,30155,0.9431395239733525 792 | sort-transformed-array,False,8,0.00025021111562881183,30163,0.9433897350889813 793 | minimize-rounding-error-to-meet-target,False,8,0.00025021111562881183,30171,0.9436399462046101 794 | assign-cookies,False,8,0.00025021111562881183,30179,0.943890157320239 795 | online-stock-span,False,8,0.00025021111562881183,30187,0.9441403684358678 796 | throne-inheritance,False,8,0.00025021111562881183,30195,0.9443905795514965 797 | cut-off-trees-for-golf-event,False,8,0.00025021111562881183,30203,0.9446407906671254 798 | minimum-moves-to-move-a-box-to-their-target-location,False,8,0.00025021111562881183,30211,0.9448910017827542 799 | number-of-ways-of-cutting-a-pizza,False,8,0.00025021111562881183,30219,0.945141212898383 800 | parallel-courses-ii,False,8,0.00025021111562881183,30227,0.9453914240140118 801 | coloring-a-border,False,8,0.00025021111562881183,30235,0.9456416351296406 802 | customer-order-frequency,False,8,0.00025021111562881183,30243,0.9458918462452695 803 | transform-to-chessboard,False,8,0.00025021111562881183,30251,0.9461420573608983 804 | minimum-number-of-flips-to-make-the-binary-string-alternating,False,8,0.00025021111562881183,30259,0.946392268476527 805 | palindrome-partitioning-ii,False,8,0.00025021111562881183,30267,0.9466424795921559 806 | big-countries,False,8,0.00025021111562881183,30275,0.9468926907077847 807 | cousins-in-binary-tree,False,8,0.00025021111562881183,30283,0.9471429018234135 808 | course-schedule-iv,False,8,0.00025021111562881183,30291,0.9473931129390423 809 | trim-a-binary-search-tree,False,8,0.00025021111562881183,30299,0.9476433240546711 810 | most-frequent-subtree-sum,False,8,0.00025021111562881183,30307,0.9478935351703 811 | clone-n-ary-tree,False,8,0.00025021111562881183,30315,0.9481437462859288 812 | minimum-number-of-removals-to-make-mountain-array,False,8,0.00025021111562881183,30323,0.9483939574015575 813 | count-subarrays-with-score-less-than-k,False,8,0.00025021111562881183,30331,0.9486441685171864 814 | two-sum-less-than-k,False,8,0.00025021111562881183,30339,0.9488943796328152 815 | convert-a-number-to-hexadecimal,False,8,0.00025021111562881183,30347,0.949144590748444 816 | closest-node-to-path-in-tree,False,8,0.00025021111562881183,30355,0.9493948018640728 817 | online-election,False,8,0.00025021111562881183,30363,0.9496450129797016 818 | number-of-sub-arrays-with-odd-sum,False,8,0.00025021111562881183,30371,0.9498952240953304 819 | count-number-of-rectangles-containing-each-point,False,8,0.00025021111562881183,30379,0.9501454352109593 820 | minimum-time-to-collect-all-apples-in-a-tree,False,8,0.00025021111562881183,30387,0.950395646326588 821 | number-of-submatrices-that-sum-to-target,False,8,0.00025021111562881183,30395,0.9506458574422169 822 | closest-leaf-in-a-binary-tree,False,8,0.00025021111562881183,30403,0.9508960685578457 823 | utf-8-validation,False,8,0.00025021111562881183,30411,0.9511462796734745 824 | my-calendar-iii,False,8,0.00025021111562881183,30419,0.9513964907891033 825 | count-nodes-equal-to-sum-of-descendants,False,8,0.00025021111562881183,30427,0.9516467019047321 826 | 3sum-smaller,False,8,0.00025021111562881183,30435,0.951896913020361 827 | minimum-cost-to-hire-k-workers,False,8,0.00025021111562881183,30443,0.9521471241359898 828 | minimum-average-difference,False,8,0.00025021111562881183,30451,0.9523973352516185 829 | construct-string-from-binary-tree,False,8,0.00025021111562881183,30459,0.9526475463672474 830 | number-of-matching-subsequences,False,8,0.00025021111562881183,30467,0.9528977574828762 831 | minimum-cost-to-change-the-final-value-of-expression,False,8,0.00025021111562881183,30475,0.953147968598505 832 | construct-quad-tree,False,8,0.00025021111562881183,30483,0.9533981797141338 833 | airplane-seat-assignment-probability,False,8,0.00025021111562881183,30491,0.9536483908297626 834 | path-sum-iv,False,8,0.00025021111562881183,30499,0.9538986019453914 835 | consecutive-numbers-sum,False,8,0.00025021111562881183,30507,0.9541488130610203 836 | 2-keys-keyboard,False,8,0.00025021111562881183,30515,0.954399024176649 837 | all-people-report-to-the-given-manager,False,7,0.00021893472617521032,30522,0.9546179589028243 838 | guess-number-higher-or-lower-ii,False,6,0.00018765833672160885,30528,0.9548056172395458 839 | search-in-a-binary-search-tree,False,6,0.00018765833672160885,30534,0.9549932755762675 840 | single-number-iii,False,6,0.00018765833672160885,30540,0.9551809339129891 841 | k-concatenation-maximum-sum,False,6,0.00018765833672160885,30546,0.9553685922497107 842 | walking-robot-simulation,False,6,0.00018765833672160885,30552,0.9555562505864323 843 | can-place-flowers,False,6,0.00018765833672160885,30558,0.9557439089231539 844 | fruit-into-baskets,False,6,0.00018765833672160885,30564,0.9559315672598755 845 | height-checker,False,6,0.00018765833672160885,30570,0.9561192255965971 846 | combination-sum-iii,False,6,0.00018765833672160885,30576,0.9563068839333188 847 | word-subsets,False,6,0.00018765833672160885,30582,0.9564945422700404 848 | count-and-say,False,6,0.00018765833672160885,30588,0.9566822006067619 849 | knight-dialer,False,6,0.00018765833672160885,30594,0.9568698589434835 850 | wiggle-sort,False,6,0.00018765833672160885,30600,0.9570575172802052 851 | high-five,False,6,0.00018765833672160885,30606,0.9572451756169268 852 | jump-game-vii,False,6,0.00018765833672160885,30612,0.9574328339536484 853 | jump-game-iii,False,6,0.00018765833672160885,30618,0.95762049229037 854 | coin-change-ii,False,6,0.00018765833672160885,30624,0.9578081506270916 855 | image-overlap,False,6,0.00018765833672160885,30630,0.9579958089638132 856 | implement-queue-using-stacks,True,6,0.00018765833672160885,30636,0.9581834673005348 857 | jewels-and-stones,False,6,0.00018765833672160885,30642,0.9583711256372565 858 | web-crawler-multithreaded,False,6,0.00018765833672160885,30648,0.9585587839739781 859 | sentence-similarity,False,6,0.00018765833672160885,30654,0.9587464423106996 860 | water-and-jug-problem,False,6,0.00018765833672160885,30660,0.9589341006474212 861 | interval-list-intersections,False,6,0.00018765833672160885,30666,0.9591217589841429 862 | insufficient-nodes-in-root-to-leaf-paths,False,6,0.00018765833672160885,30672,0.9593094173208645 863 | insert-into-a-binary-search-tree,False,6,0.00018765833672160885,30678,0.9594970756575861 864 | shortest-impossible-sequence-of-rolls,False,6,0.00018765833672160885,30684,0.9596847339943076 865 | vowel-spellchecker,False,6,0.00018765833672160885,30690,0.9598723923310293 866 | sum-of-two-integers,False,6,0.00018765833672160885,30696,0.9600600506677509 867 | count-number-of-bad-pairs,False,6,0.00018765833672160885,30702,0.9602477090044725 868 | substring-with-concatenation-of-all-words,False,6,0.00018765833672160885,30708,0.9604353673411942 869 | fancy-sequence,False,6,0.00018765833672160885,30714,0.9606230256779157 870 | delete-node-in-a-bst,False,6,0.00018765833672160885,30720,0.9608106840146373 871 | strobogrammatic-number-iii,False,6,0.00018765833672160885,30726,0.960998342351359 872 | excel-sheet-column-number,False,6,0.00018765833672160885,30732,0.9611860006880806 873 | exam-room,False,6,0.00018765833672160885,30738,0.9613736590248022 874 | last-stone-weight,False,6,0.00018765833672160885,30744,0.9615613173615238 875 | design-a-stack-with-increment-operation,False,6,0.00018765833672160885,30750,0.9617489756982454 876 | check-if-one-string-swap-can-make-strings-equal,False,6,0.00018765833672160885,30756,0.961936634034967 877 | design-linked-list,False,6,0.00018765833672160885,30762,0.9621242923716886 878 | check-if-array-pairs-are-divisible-by-k,False,6,0.00018765833672160885,30768,0.9623119507084102 879 | evaluate-boolean-binary-tree,False,6,0.00018765833672160885,30774,0.9624996090451319 880 | equal-tree-partition,False,6,0.00018765833672160885,30780,0.9626872673818534 881 | employee-free-time,False,6,0.00018765833672160885,30786,0.962874925718575 882 | duplicate-zeros,False,6,0.00018765833672160885,30792,0.9630625840552967 883 | design-underground-system,False,6,0.00018765833672160885,30798,0.9632502423920183 884 | sum-of-square-numbers,False,6,0.00018765833672160885,30804,0.9634379007287399 885 | sum-of-unique-elements,False,6,0.00018765833672160885,30810,0.9636255590654614 886 | sum-of-subsequence-widths,False,6,0.00018765833672160885,30816,0.9638132174021831 887 | decoded-string-at-index,False,6,0.00018765833672160885,30822,0.9640008757389047 888 | adding-spaces-to-a-string,False,6,0.00018765833672160885,30828,0.9641885340756263 889 | count-number-of-pairs-with-absolute-difference-k,False,6,0.00018765833672160885,30834,0.964376192412348 890 | sparse-matrix-multiplication,False,6,0.00018765833672160885,30840,0.9645638507490695 891 | find-unique-binary-string,False,6,0.00018765833672160885,30846,0.9647515090857911 892 | unique-email-addresses,False,6,0.00018765833672160885,30852,0.9649391674225127 893 | find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance,False,6,0.00018765833672160885,30858,0.9651268257592344 894 | count-pairs-of-nodes,False,6,0.00018765833672160885,30864,0.965314484095956 895 | count-special-integers,False,6,0.00018765833672160885,30870,0.9655021424326776 896 | find-target-indices-after-sorting-array,False,6,0.00018765833672160885,30876,0.9656898007693991 897 | distinct-numbers-in-each-subarray,False,6,0.00018765833672160885,30882,0.9658774591061208 898 | ugly-number-iii,False,6,0.00018765833672160885,30888,0.9660651174428424 899 | special-array-with-x-elements-greater-than-or-equal-x,False,6,0.00018765833672160885,30894,0.966252775779564 900 | string-matching-in-an-array,False,6,0.00018765833672160885,30900,0.9664404341162857 901 | course-schedule-iii,False,6,0.00018765833672160885,30906,0.9666280924530072 902 | find-k-length-substrings-with-no-repeated-characters,False,6,0.00018765833672160885,30912,0.9668157507897288 903 | check-if-a-parentheses-string-can-be-valid,False,6,0.00018765833672160885,30918,0.9670034091264504 904 | find-in-mountain-array,False,6,0.00018765833672160885,30924,0.9671910674631721 905 | stone-game-iv,False,6,0.00018765833672160885,30930,0.9673787257998937 906 | toss-strange-coins,False,6,0.00018765833672160885,30936,0.9675663841366152 907 | cyclically-rotating-a-grid,False,6,0.00018765833672160885,30942,0.9677540424733369 908 | string-compression-ii,False,6,0.00018765833672160885,30948,0.9679417008100585 909 | evaluate-the-bracket-pairs-of-a-string,False,6,0.00018765833672160885,30954,0.9681293591467801 910 | search-in-rotated-sorted-array-ii,False,6,0.00018765833672160885,30960,0.9683170174835017 911 | max-increase-to-keep-city-skyline,False,6,0.00018765833672160885,30966,0.9685046758202233 912 | remove-sub-folders-from-the-filesystem,False,6,0.00018765833672160885,30972,0.9686923341569449 913 | minimum-swaps-to-group-all-1s-together-ii,False,6,0.00018765833672160885,30978,0.9688799924936665 914 | reachable-nodes-in-subdivided-graph,False,6,0.00018765833672160885,30984,0.9690676508303881 915 | minimum-time-to-finish-the-race,False,6,0.00018765833672160885,30990,0.9692553091671098 916 | maximum-average-pass-ratio,False,6,0.00018765833672160885,30996,0.9694429675038314 917 | number-of-ways-to-rearrange-sticks-with-k-sticks-visible,False,6,0.00018765833672160885,31002,0.9696306258405529 918 | rectangle-area,False,6,0.00018765833672160885,31008,0.9698182841772746 919 | rectangle-overlap,False,6,0.00018765833672160885,31014,0.9700059425139962 920 | max-consecutive-ones-ii,False,6,0.00018765833672160885,31020,0.9701936008507178 921 | max-consecutive-ones,False,6,0.00018765833672160885,31026,0.9703812591874394 922 | matrix-diagonal-sum,False,6,0.00018765833672160885,31032,0.970568917524161 923 | number-of-visible-people-in-a-queue,False,6,0.00018765833672160885,31038,0.9707565758608826 924 | map-of-highest-peak,False,6,0.00018765833672160885,31044,0.9709442341976042 925 | remove-boxes,False,6,0.00018765833672160885,31050,0.9711318925343259 926 | remove-duplicates-from-sorted-list-ii,False,6,0.00018765833672160885,31056,0.9713195508710475 927 | make-array-strictly-increasing,False,6,0.00018765833672160885,31062,0.971507209207769 928 | most-common-word,False,6,0.00018765833672160885,31068,0.9716948675444906 929 | number-of-people-aware-of-a-secret,False,6,0.00018765833672160885,31074,0.9718825258812123 930 | lowest-common-ancestor-of-a-binary-tree-iv,False,6,0.00018765833672160885,31080,0.9720701842179339 931 | move-pieces-to-obtain-a-string,False,6,0.00018765833672160885,31086,0.9722578425546555 932 | number-of-music-playlists,False,6,0.00018765833672160885,31092,0.972445500891377 933 | remove-outermost-parentheses,False,6,0.00018765833672160885,31098,0.9726331592280987 934 | maximum-non-negative-product-in-a-matrix,False,6,0.00018765833672160885,31104,0.9728208175648203 935 | minimum-subsequence-in-non-increasing-order,False,6,0.00018765833672160885,31110,0.9730084759015419 936 | pyramid-transition-matrix,False,6,0.00018765833672160885,31116,0.9731961342382636 937 | paint-house,False,6,0.00018765833672160885,31122,0.9733837925749852 938 | minimum-moves-to-equal-array-elements-ii,False,6,0.00018765833672160885,31128,0.9735714509117067 939 | minimum-initial-energy-to-finish-tasks,False,6,0.00018765833672160885,31134,0.9737591092484283 940 | minimum-falling-path-sum-ii,False,6,0.00018765833672160885,31140,0.97394676758515 941 | minimum-number-of-arrows-to-burst-balloons,False,6,0.00018765833672160885,31146,0.9741344259218716 942 | palindrome-permutation,False,6,0.00018765833672160885,31152,0.9743220842585932 943 | combine-two-tables,False,6,0.00018765833672160885,31158,0.9745097425953148 944 | minimum-difficulty-of-a-job-schedule,False,6,0.00018765833672160885,31164,0.9746974009320364 945 | minimum-number-of-operations-to-convert-time,False,6,0.00018765833672160885,31170,0.974885059268758 946 | minimum-difference-between-largest-and-smallest-value-in-three-moves,False,6,0.00018765833672160885,31176,0.9750727176054796 947 | paths-in-matrix-whose-sum-is-divisible-by-k,False,6,0.00018765833672160885,31182,0.9752603759422013 948 | maximum-product-of-word-lengths,False,6,0.00018765833672160885,31188,0.9754480342789228 949 | minimum-adjacent-swaps-to-reach-the-kth-smallest-number,False,6,0.00018765833672160885,31194,0.9756356926156444 950 | optimize-water-distribution-in-a-village,False,6,0.00018765833672160885,31200,0.975823350952366 951 | meeting-scheduler,False,6,0.00018765833672160885,31206,0.9760110092890877 952 | maximum-width-ramp,False,6,0.00018765833672160885,31212,0.9761986676258093 953 | maximum-vacation-days,False,6,0.00018765833672160885,31218,0.9763863259625308 954 | optimal-partition-of-string,False,6,0.00018765833672160885,31224,0.9765739842992525 955 | minimum-operations-to-make-the-array-k-increasing,False,6,0.00018765833672160885,31230,0.9767616426359741 956 | minimum-speed-to-arrive-on-time,False,6,0.00018765833672160885,31236,0.9769493009726957 957 | maximum-score-from-performing-multiplication-operations,False,6,0.00018765833672160885,31242,0.9771369593094174 958 | remove-stones-to-minimize-the-total,False,6,0.00018765833672160885,31248,0.977324617646139 959 | minimum-non-zero-product-of-the-array-elements,False,6,0.00018765833672160885,31254,0.9775122759828605 960 | linked-list-components,False,6,0.00018765833672160885,31260,0.9776999343195821 961 | repeated-string-match,False,6,0.00018765833672160885,31266,0.9778875926563038 962 | reverse-bits,False,6,0.00018765833672160885,31272,0.9780752509930254 963 | nim-game,False,6,0.00018765833672160885,31278,0.978262909329747 964 | reshape-the-matrix,False,6,0.00018765833672160885,31284,0.9784505676664685 965 | brightest-position-on-street,False,6,0.00018765833672160885,31290,0.9786382260031902 966 | non-decreasing-array,False,6,0.00018765833672160885,31296,0.9788258843399118 967 | best-poker-hand,False,6,0.00018765833672160885,31302,0.9790135426766334 968 | nearest-exit-from-entrance-in-maze,False,6,0.00018765833672160885,31308,0.9792012010133551 969 | line-reflection,False,6,0.00018765833672160885,31314,0.9793888593500766 970 | longest-palindromic-subsequence,False,6,0.00018765833672160885,31320,0.9795765176867982 971 | n-ary-tree-postorder-traversal,False,6,0.00018765833672160885,31326,0.9797641760235198 972 | longest-univalue-path,False,6,0.00018765833672160885,31332,0.9799518343602415 973 | bricks-falling-when-hit,False,6,0.00018765833672160885,31338,0.9801394926969631 974 | longest-substring-with-at-most-two-distinct-characters,False,6,0.00018765833672160885,31344,0.9803271510336846 975 | count-sorted-vowel-strings,False,5,0.0001563819472680074,31349,0.9804835329809527 976 | word-frequency,False,5,0.0001563819472680074,31354,0.9806399149282207 977 | remove-interval,False,5,0.0001563819472680074,31359,0.9807962968754887 978 | element-appearing-more-than-25-in-sorted-array,False,5,0.0001563819472680074,31364,0.9809526788227567 979 | valid-phone-numbers,False,5,0.0001563819472680074,31369,0.9811090607700247 980 | validate-ip-address,False,5,0.0001563819472680074,31374,0.9812654427172928 981 | nth-highest-salary,False,5,0.0001563819472680074,31379,0.9814218246645607 982 | permutation-sequence,False,4,0.00012510555781440592,31383,0.9815469302223752 983 | distinct-subsequences,False,4,0.00012510555781440592,31387,0.9816720357801896 984 | binary-searchable-numbers-in-an-unsorted-array,False,4,0.00012510555781440592,31391,0.9817971413380039 985 | powerful-integers,False,4,0.00012510555781440592,31395,0.9819222468958183 986 | kth-missing-positive-number,False,4,0.00012510555781440592,31399,0.9820473524536327 987 | distribute-candies-to-people,False,4,0.00012510555781440592,31403,0.9821724580114471 988 | perfect-rectangle,False,4,0.00012510555781440592,31407,0.9822975635692616 989 | check-if-the-sentence-is-pangram,False,4,0.00012510555781440592,31411,0.982422669127076 990 | minimum-number-of-vertices-to-reach-all-nodes,False,4,0.00012510555781440592,31415,0.9825477746848904 991 | min-cost-climbing-stairs,False,4,0.00012510555781440592,31419,0.9826728802427048 992 | plus-one-linked-list,False,4,0.00012510555781440592,31423,0.9827979858005191 993 | word-pattern,False,4,0.00012510555781440592,31427,0.9829230913583336 994 | domino-and-tromino-tiling,False,4,0.00012510555781440592,31431,0.983048196916148 995 | check-if-string-is-a-prefix-of-array,False,4,0.00012510555781440592,31435,0.9831733024739624 996 | nth-digit,False,4,0.00012510555781440592,31439,0.9832984080317768 997 | maximum-sum-score-of-array,False,4,0.00012510555781440592,31443,0.9834235135895912 998 | base-7,False,4,0.00012510555781440592,31447,0.9835486191474057 999 | elimination-game,False,4,0.00012510555781440592,31451,0.9836737247052201 1000 | k-similar-strings,False,4,0.00012510555781440592,31455,0.9837988302630344 1001 | encode-string-with-shortest-length,False,4,0.00012510555781440592,31459,0.9839239358208488 1002 | sales-analysis-ii,False,4,0.00012510555781440592,31463,0.9840490413786632 1003 | detect-capital,False,4,0.00012510555781440592,31467,0.9841741469364776 1004 | minimum-cost-to-merge-stones,False,4,0.00012510555781440592,31471,0.9842992524942921 1005 | super-pow,False,4,0.00012510555781440592,31475,0.9844243580521065 1006 | root-equals-sum-of-children,False,4,0.00012510555781440592,31479,0.9845494636099209 1007 | add-to-array-form-of-integer,False,4,0.00012510555781440592,31483,0.9846745691677353 1008 | cutting-ribbons,False,4,0.00012510555781440592,31487,0.9847996747255496 1009 | robot-return-to-origin,False,4,0.00012510555781440592,31491,0.984924780283364 1010 | largest-substring-between-two-equal-characters,False,4,0.00012510555781440592,31495,0.9850498858411785 1011 | decode-the-slanted-ciphertext,False,4,0.00012510555781440592,31499,0.9851749913989929 1012 | decode-ways-ii,False,4,0.00012510555781440592,31503,0.9853000969568073 1013 | partition-list,False,4,0.00012510555781440592,31507,0.9854252025146217 1014 | decode-xored-array,False,4,0.00012510555781440592,31511,0.9855503080724362 1015 | the-most-frequently-ordered-products-for-each-customer,False,4,0.00012510555781440592,31515,0.9856754136302506 1016 | path-crossing,False,4,0.00012510555781440592,31519,0.9858005191880649 1017 | lexicographical-numbers,False,4,0.00012510555781440592,31523,0.9859256247458793 1018 | minimum-number-of-days-to-make-m-bouquets,False,4,0.00012510555781440592,31527,0.9860507303036937 1019 | additive-number,False,4,0.00012510555781440592,31531,0.9861758358615081 1020 | destination-city,False,4,0.00012510555781440592,31535,0.9863009414193226 1021 | largest-number-at-least-twice-of-others,False,4,0.00012510555781440592,31539,0.986426046977137 1022 | delete-columns-to-make-sorted,False,4,0.00012510555781440592,31543,0.9865511525349514 1023 | best-time-to-buy-and-sell-stock-with-cooldown,False,4,0.00012510555781440592,31547,0.9866762580927658 1024 | reverse-words-in-a-string-ii,False,4,0.00012510555781440592,31551,0.9868013636505801 1025 | number-of-days-between-two-dates,False,4,0.00012510555781440592,31555,0.9869264692083946 1026 | kth-smallest-product-of-two-sorted-arrays,False,4,0.00012510555781440592,31559,0.987051574766209 1027 | minimum-degree-of-a-connected-trio-in-a-graph,False,4,0.00012510555781440592,31563,0.9871766803240234 1028 | two-furthest-houses-with-different-colors,False,4,0.00012510555781440592,31567,0.9873017858818378 1029 | confusing-number-ii,False,4,0.00012510555781440592,31571,0.9874268914396522 1030 | minimum-cost-to-reach-destination-in-time,False,4,0.00012510555781440592,31575,0.9875519969974667 1031 | reverse-substrings-between-each-pair-of-parentheses,False,4,0.00012510555781440592,31579,0.9876771025552811 1032 | rotated-digits,False,4,0.00012510555781440592,31583,0.9878022081130954 1033 | last-stone-weight-ii,False,4,0.00012510555781440592,31587,0.9879273136709098 1034 | average-salary-departments-vs-company,False,4,0.00012510555781440592,31591,0.9880524192287242 1035 | excel-sheet-column-title,False,4,0.00012510555781440592,31595,0.9881775247865386 1036 | h-index-ii,False,4,0.00012510555781440592,31599,0.9883026303443531 1037 | find-the-difference-of-two-arrays,False,4,0.00012510555781440592,31603,0.9884277359021675 1038 | find-the-highest-altitude,False,4,0.00012510555781440592,31607,0.9885528414599819 1039 | reformat-the-string,False,4,0.00012510555781440592,31611,0.9886779470177962 1040 | ip-to-cidr,False,4,0.00012510555781440592,31615,0.9888030525756106 1041 | bulb-switcher,False,4,0.00012510555781440592,31619,0.988928158133425 1042 | alphabet-board-path,False,4,0.00012510555781440592,31623,0.9890532636912395 1043 | missing-number-in-arithmetic-progression,False,4,0.00012510555781440592,31627,0.9891783692490539 1044 | number-of-steps-to-reduce-a-number-to-zero,False,4,0.00012510555781440592,31631,0.9893034748068683 1045 | monotonic-array,False,4,0.00012510555781440592,31635,0.9894285803646827 1046 | remove-duplicates-from-sorted-list,False,4,0.00012510555781440592,31639,0.9895536859224972 1047 | integer-break,False,4,0.00012510555781440592,31643,0.9896787914803115 1048 | insertion-sort-list,False,4,0.00012510555781440592,31647,0.9898038970381259 1049 | count-good-numbers,False,4,0.00012510555781440592,31651,0.9899290025959403 1050 | construct-target-array-with-multiple-sums,False,4,0.00012510555781440592,31655,0.9900541081537547 1051 | remove-linked-list-elements,False,4,0.00012510555781440592,31659,0.9901792137115691 1052 | remove-max-number-of-edges-to-keep-graph-fully-traversable,False,4,0.00012510555781440592,31663,0.9903043192693836 1053 | longest-word-with-all-prefixes,False,4,0.00012510555781440592,31667,0.990429424827198 1054 | shuffle-string,False,4,0.00012510555781440592,31671,0.9905545303850124 1055 | house-robber-ii,False,4,0.00012510555781440592,31675,0.9906796359428267 1056 | html-entity-parser,False,4,0.00012510555781440592,31679,0.9908047415006411 1057 | water-bottles,False,4,0.00012510555781440592,31683,0.9909298470584555 1058 | number-of-islands-ii,False,4,0.00012510555781440592,31687,0.99105495261627 1059 | image-smoother,False,4,0.00012510555781440592,31691,0.9911800581740844 1060 | shortest-path-with-alternating-colors,False,4,0.00012510555781440592,31695,0.9913051637318988 1061 | count-good-meals,False,4,0.00012510555781440592,31699,0.9914302692897132 1062 | maximum-sum-of-3-non-overlapping-subarrays,False,4,0.00012510555781440592,31703,0.9915553748475276 1063 | minimum-time-to-complete-trips,False,4,0.00012510555781440592,31707,0.991680480405342 1064 | maximum-binary-tree-ii,False,4,0.00012510555781440592,31711,0.9918055859631564 1065 | one-edit-distance,False,4,0.00012510555781440592,31715,0.9919306915209708 1066 | n-ary-tree-level-order-traversal,False,4,0.00012510555781440592,31719,0.9920557970787852 1067 | maximum-population-year,False,4,0.00012510555781440592,31723,0.9921809026365996 1068 | maximum-of-absolute-value-expression,False,4,0.00012510555781440592,31727,0.9923060081944141 1069 | find-cumulative-salary-of-an-employee,False,4,0.00012510555781440592,31731,0.9924311137522285 1070 | broken-calculator,False,4,0.00012510555781440592,31735,0.9925562193100429 1071 | build-array-from-permutation,False,4,0.00012510555781440592,31739,0.9926813248678572 1072 | arithmetic-slices,False,4,0.00012510555781440592,31743,0.9928064304256716 1073 | average-salary-excluding-the-minimum-and-maximum-salary,False,4,0.00012510555781440592,31747,0.992931535983486 1074 | sorting-the-sentence,False,4,0.00012510555781440592,31751,0.9930566415413005 1075 | maximum-average-subarray-i,False,4,0.00012510555781440592,31755,0.9931817470991149 1076 | scramble-string,False,4,0.00012510555781440592,31759,0.9933068526569293 1077 | long-pressed-name,False,4,0.00012510555781440592,31763,0.9934319582147437 1078 | find-interview-candidates,False,4,0.00012510555781440592,31767,0.9935570637725581 1079 | apply-discount-to-prices,False,4,0.00012510555781440592,31771,0.9936821693303725 1080 | split-two-strings-to-make-palindrome,False,4,0.00012510555781440592,31775,0.9938072748881869 1081 | maximum-alternating-subsequence-sum,False,4,0.00012510555781440592,31779,0.9939323804460013 1082 | maximum-absolute-sum-of-any-subarray,False,4,0.00012510555781440592,31783,0.9940574860038157 1083 | exchange-seats,False,4,0.00012510555781440592,31787,0.9941825915616301 1084 | count-items-matching-a-rule,False,4,0.00012510555781440592,31791,0.9943076971194446 1085 | missing-element-in-sorted-array,False,4,0.00012510555781440592,31795,0.994432802677259 1086 | student-attendance-record-i,False,4,0.00012510555781440592,31799,0.9945579082350734 1087 | arithmetic-subarrays,False,4,0.00012510555781440592,31803,0.9946830137928877 1088 | ugly-number,False,3,9.382916836080442e-05,31806,0.9947768429612486 1089 | number-of-ways-to-paint-n-3-grid,False,3,9.382916836080442e-05,31809,0.9948706721296093 1090 | consecutive-numbers,False,3,9.382916836080442e-05,31812,0.9949645012979702 1091 | customers-who-bought-all-products,False,3,9.382916836080442e-05,31815,0.995058330466331 1092 | rising-temperature,False,3,9.382916836080442e-05,31818,0.9951521596346917 1093 | number-of-calls-between-two-persons,False,3,9.382916836080442e-05,31821,0.9952459888030526 1094 | replace-all-s-to-avoid-consecutive-repeating-characters,False,3,9.382916836080442e-05,31824,0.9953398179714134 1095 | find-the-start-and-end-number-of-continuous-ranges,False,3,9.382916836080442e-05,31827,0.9954336471397742 1096 | rearrange-spaces-between-words,False,3,9.382916836080442e-05,31830,0.995527476308135 1097 | champagne-tower,False,3,9.382916836080442e-05,31833,0.9956213054764957 1098 | first-and-last-call-on-the-same-day,False,3,9.382916836080442e-05,31836,0.9957151346448566 1099 | split-linked-list-in-parts,False,3,9.382916836080442e-05,31839,0.9958089638132174 1100 | find-customer-referee,False,3,9.382916836080442e-05,31842,0.9959027929815782 1101 | products-price-for-each-store,False,3,9.382916836080442e-05,31845,0.995996622149939 1102 | recyclable-and-low-fat-products,False,3,9.382916836080442e-05,31848,0.9960904513182998 1103 | insert-into-a-sorted-circular-linked-list,False,3,9.382916836080442e-05,31851,0.9961842804866606 1104 | maximize-distance-to-closest-person,False,3,9.382916836080442e-05,31854,0.9962781096550214 1105 | to-lower-case,False,3,9.382916836080442e-05,31857,0.9963719388233823 1106 | defanging-an-ip-address,False,3,9.382916836080442e-05,31860,0.996465767991743 1107 | sales-by-day-of-the-week,False,3,9.382916836080442e-05,31863,0.9965595971601038 1108 | grand-slam-titles,False,2,6.255277890720296e-05,31865,0.996622149939011 1109 | reformat-department-table,False,2,6.255277890720296e-05,31867,0.9966847027179182 1110 | remove-all-occurrences-of-a-substring,False,2,6.255277890720296e-05,31869,0.9967472554968254 1111 | length-of-last-word,False,2,6.255277890720296e-05,31871,0.9968098082757326 1112 | article-views-ii,False,2,6.255277890720296e-05,31873,0.9968723610546398 1113 | license-key-formatting,False,2,6.255277890720296e-05,31875,0.996934913833547 1114 | managers-with-at-least-5-direct-reports,False,2,6.255277890720296e-05,31877,0.9969974666124543 1115 | friend-requests-i-overall-acceptance-rate,False,2,6.255277890720296e-05,31879,0.9970600193913615 1116 | number-of-dice-rolls-with-target-sum,False,2,6.255277890720296e-05,31881,0.9971225721702687 1117 | goat-latin,False,2,6.255277890720296e-05,31883,0.9971851249491759 1118 | consecutive-available-seats,False,2,6.255277890720296e-05,31885,0.9972476777280831 1119 | longer-contiguous-segments-of-ones-than-zeros,False,2,6.255277890720296e-05,31887,0.9973102305069903 1120 | remove-one-element-to-make-the-array-strictly-increasing,False,2,6.255277890720296e-05,31889,0.9973727832858975 1121 | human-traffic-of-stadium,False,2,6.255277890720296e-05,31891,0.9974353360648047 1122 | remove-vowels-from-a-string,False,2,6.255277890720296e-05,31893,0.9974978888437119 1123 | shortest-distance-in-a-line,False,2,6.255277890720296e-05,31895,0.997560441622619 1124 | sales-person,False,2,6.255277890720296e-05,31897,0.9976229944015262 1125 | k-inverse-pairs-array,False,2,6.255277890720296e-05,31899,0.9976855471804335 1126 | replace-elements-with-greatest-element-on-right-side,False,2,6.255277890720296e-05,31901,0.9977480999593407 1127 | apples-oranges,False,2,6.255277890720296e-05,31903,0.9978106527382479 1128 | report-contiguous-dates,False,2,6.255277890720296e-05,31905,0.9978732055171551 1129 | longest-continuous-increasing-subsequence,False,2,6.255277890720296e-05,31907,0.9979357582960623 1130 | consecutive-characters,False,2,6.255277890720296e-05,31909,0.9979983110749695 1131 | hamming-distance,False,2,6.255277890720296e-05,31911,0.9980608638538767 1132 | customer-placing-the-largest-number-of-orders,False,2,6.255277890720296e-05,31913,0.9981234166327839 1133 | valid-permutations-for-di-sequence,False,2,6.255277890720296e-05,31915,0.9981859694116911 1134 | count-hills-and-valleys-in-an-array,False,2,6.255277890720296e-05,31917,0.9982485221905983 1135 | decompress-run-length-encoded-list,False,2,6.255277890720296e-05,31919,0.9983110749695056 1136 | the-dining-philosophers,False,2,6.255277890720296e-05,31921,0.9983736277484128 1137 | tenth-line,False,2,6.255277890720296e-05,31923,0.99843618052732 1138 | delete-duplicate-emails,False,2,6.255277890720296e-05,31925,0.9984987333062272 1139 | triangle-judgement,False,2,6.255277890720296e-05,31927,0.9985612860851343 1140 | ads-performance,False,2,6.255277890720296e-05,31929,0.9986238388640415 1141 | swap-salary,False,2,6.255277890720296e-05,31931,0.9986863916429487 1142 | department-top-three-salaries,False,2,6.255277890720296e-05,31933,0.9987489444218559 1143 | paint-fence,False,2,6.255277890720296e-05,31935,0.9988114972007631 1144 | merge-in-between-linked-lists,False,2,6.255277890720296e-05,31937,0.9988740499796703 1145 | primary-department-for-each-employee,False,2,6.255277890720296e-05,31939,0.9989366027585775 1146 | prime-palindrome,False,2,6.255277890720296e-05,31941,0.9989991555374848 1147 | print-in-order,False,2,6.255277890720296e-05,31943,0.999061708316392 1148 | students-report-by-geography,False,2,6.255277890720296e-05,31945,0.9991242610952992 1149 | 1-bit-and-2-bit-characters,False,2,6.255277890720296e-05,31947,0.9991868138742064 1150 | product-price-at-a-given-date,False,2,6.255277890720296e-05,31949,0.9992493666531136 1151 | average-time-of-process-per-machine,False,2,6.255277890720296e-05,31951,0.9993119194320208 1152 | count-odd-numbers-in-an-interval-range,False,2,6.255277890720296e-05,31953,0.999374472210928 1153 | average-selling-price,False,2,6.255277890720296e-05,31955,0.9994370249898352 1154 | actors-and-directors-who-cooperated-at-least-three-times,False,2,6.255277890720296e-05,31957,0.9994995777687424 1155 | number-of-ways-to-stay-in-the-same-place-after-some-steps,False,2,6.255277890720296e-05,31959,0.9995621305476495 1156 | user-activity-for-the-past-30-days-i,False,2,6.255277890720296e-05,31961,0.9996246833265567 1157 | user-activity-for-the-past-30-days-ii,False,2,6.255277890720296e-05,31963,0.999687236105464 1158 | reaching-points,False,2,6.255277890720296e-05,31965,0.9997497888843712 1159 | valid-mountain-array,False,2,6.255277890720296e-05,31967,0.9998123416632784 1160 | active-users,False,2,6.255277890720296e-05,31969,0.9998748944421856 1161 | customers-who-never-order,False,2,6.255277890720296e-05,31971,0.9999374472210928 1162 | bitwise-and-of-numbers-range,False,2,6.255277890720296e-05,31973,1.0 1163 | --------------------------------------------------------------------------------