{"id":13935278,"url":"https://github.com/arpankg/ctci-python-solutions","last_synced_at":"2025-04-12T15:32:46.779Z","repository":{"id":54452813,"uuid":"324428344","full_name":"arpankg/ctci-python-solutions","owner":"arpankg","description":"Cracking the Coding Interview in Python 3. The solutions all have detailed explanations with visuals.","archived":false,"fork":false,"pushed_at":"2021-06-24T15:57:02.000Z","size":89,"stargazers_count":1064,"open_issues_count":1,"forks_count":158,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-04-03T14:12:47.484Z","etag":null,"topics":["cracking-the-coding-interview","gayle-laakmann-mcdowell","interview-practice","interview-preparation","interview-questions","python","python3"],"latest_commit_sha":null,"homepage":"https://quastor.org/cracking-the-coding-interview/arrays-and-strings/one-away","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arpankg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-25T20:25:47.000Z","updated_at":"2025-02-26T04:49:11.000Z","dependencies_parsed_at":"2022-08-13T16:10:22.465Z","dependency_job_id":null,"html_url":"https://github.com/arpankg/ctci-python-solutions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpankg%2Fctci-python-solutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpankg%2Fctci-python-solutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpankg%2Fctci-python-solutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arpankg%2Fctci-python-solutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arpankg","download_url":"https://codeload.github.com/arpankg/ctci-python-solutions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589854,"owners_count":21129690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cracking-the-coding-interview","gayle-laakmann-mcdowell","interview-practice","interview-preparation","interview-questions","python","python3"],"created_at":"2024-08-07T23:01:32.572Z","updated_at":"2025-04-12T15:32:46.755Z","avatar_url":"https://github.com/arpankg.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# Cracking the Coding Interview in Python - Solutions with Explanations\n\nDetailed explanations to the coding interview questions in CTCI. The solutions are written in Python 3.\n\n**If you find this useful, a Github star would be much appreciated!!**  ⭐ ⭐ ⭐ \n\n## Arrays and Strings\n|Problem Number | Problem Name | Status|\n|--- | --- | --- |\n| 1.1 | Is Unique | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/is-unique) |\n| 1.2 | Check Permutation | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/check-permutation) |\n1.3 | URLify | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/urlify) |\n1.4 | Palindrome Permutation |  [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/palindrome-permutation) |\n1.5 | One Away | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/one-away) |\n1.6 | String Compression | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/string-compression) |\n1.7 | Rotate Matrix | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/rotate-matrix) |\n1.8 | Zero Matrix | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/zero-matrix) |\n1.9 | String Rotation | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/string-rotation) |\n\n## Linked Lists\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 2.1 | Remove Dups | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/remove-duplicates) |\n| 2.2 | Return Kth to Last | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/return-kth-to-last) |\n| 2.3 | Delete Middle Node | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/delete-middle-node) |\n| 2.4 | Partition | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/partition) |\n| 2.5 | Sum List | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/sum-list) |\n| 2.6 | Palindrome | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/palindrome) |\n| 2.7 | Intersection | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/intersection) |\n| 2.8 | Loop Detection | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/loop-detection) |\n\n## Stacks and Queues\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 3.1 | Three In One | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/three-in-one) |\n| 3.2 | Stack Min | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/stack-min) |\n| 3.3 | Stack of Plates | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/stack-of-plates)|\n| 3.4 | Queue via Stacks | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/queue-via-stacks) |\n| 3.5 | Sort Stack | ❌ |\n| 3.6 | Animal Shelter | ❌ |\n\n## Trees and Graphs\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 4.1 | Route Between Nodes | ❌ |\n| 4.2 | Minimal Tree | ❌ |\n| 4.3 | List of Depths | ❌ |\n| 4.4 | Check Balanced | ❌ |\n| 4.5 | Validate BST |  ❌ |\n| 4.6 | Successor | ❌ |\n| 4.7 | Build Order | ❌ |\n| 4.8 | First Common Ancestor | ❌ |\n| 4.9 | BST Sequence | ❌ |\n| 4.10 | Check Subtree | ❌ |\n| 4.11 | Random Node | ❌ |\n| 4.12 | Paths with Sum | ❌ |\n\n## Bit Manipulation\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 5.1 | Insertion | ❌ |\n| 5.2 | Binary to String | ❌ |\n| 5.3 | Flip Bit to Win | ❌ |\n| 5.4 | Next Number | ❌ |\n| 5.5 | Debugger | ❌ |\n| 5.6 | Conversion | ❌ |\n| 5.7 | Pairwise Swap | ❌ |\n| 5.8 | Draw Line | ❌ |\n\n## Object Oriented Design\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 7.1 | Deck of Cards | ❌ |\n| 7.2 | Call Center | ❌ |\n| 7.3 | Jukebox | ❌ |\n| 7.4 | Parking Lot | ❌ |\n| 7.5 | Online Book Reader | ❌ |\n| 7.6 | Jigsaw | ❌ |\n| 7.7 | Chat Server | ❌ |\n| 7.8 | Othello | ❌ |\n| 7.9 | Circular Array | ❌ |\n\n## Recursion and Dynamic Programming\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 8.1 | Triple Step | ❌ |\n| 8.2 | Robot in a Grid | ❌ |\n| 8.3 | Magic Index | ❌ |\n| 8.4 | Power Set | ❌ |\n| 8.5 | Recursive Multiply | ❌ |\n| 8.6 | Towers of Hanoi | ❌ |\n| 8.7 | Permutation without Dups | ❌ |\n| 8.8 | Permutation with Dups | ❌ |\n| 8.9 | Parens | ❌ |\n| 8.10 | Paint Fill | ❌ |\n| 8.11 | Coins | ❌ |\n| 8.12 | Eight Queens | ❌ |\n| 8.13 | Stack of Boxes | ❌ |\n| 8.14 | Boolean Evaluation | ❌ |\n\n## Sorting and Searching\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 10.1 | Sorted Merge | ❌ |\n| 10.2 | Group Anagram | ❌ |\n| 10.3 | Search in Rotated Array | ❌ |\n| 10.4 | Sorted Search, No Size | ❌ |\n| 10.5 | Sparse Search | ❌ |\n| 10.6 | Sort Big File | ❌ |\n| 10.7 | Missing Int | ❌ |\n| 10.8 | Find Duplicates | ❌ |\n| 10.9 | Sorted Matrix Search | ❌ |\n| 10.10 | Rank from Stream | ❌ |\n| 10.11 | Peaks and Valleys | ❌ | \n\n## Moderate\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 16.1 | Number Swapper | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/moderate/number-swapper) |\n| 16.2 | Word Frequencies | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/moderate/word-frequencies) |\n| 16.3 | Intersection | ❌ |\n| 16.4 | Tic Tac Win | ❌ |\n| 16.5 | Factorial Zeros | ❌ |\n| 16.6 | Smallest Difference | ❌ |\n| 16.7 | Number Max | ❌ |\n| 16.8 | English Int | ❌ |\n| 16.9 | Operations | ❌ |\n| 16.10 | Living People | ❌ |\n| 16.11 | Diving Board | ❌ |\n| 16.12 | XML Encoding | ❌ |\n| 16.13 | Bisect Squares | ❌ |\n| 16.14 | Best Line | ❌ |\n| 16.15 | Master Mind | ❌ |\n| 16.16 | Sub Sort | ❌ |\n| 16.17 | Contiguous Sequence | ❌ |\n| 16.18 | Pattern Matching | ❌ |\n| 16.19 | Pond Sizes | ❌ |\n| 16.20 | T9 | ❌ |\n| 16.21 | Sum Swap | ❌ |\n| 16.22 | Langton's Ant | ❌ |\n| 16.23 | Rand7 from Rand5 | ❌ |\n| 16.24 | Pairs with Sum | ❌ |\n| 16.25 | LRU Cache | ❌ |\n| 16.26 | Calculator| ❌ |\n\n## Hard\n\n| Problem Number | Problem Name | Status |\n| --- | --- | --- |\n| 17.1 | Add Without Plus | ❌ |\n| 17.2 | Shuffle | ❌ |\n| 17.3 | Random Set | ❌ |\n| 17.4 | Missing Number | ❌ |\n| 17.5 | Letters and Numbers | ❌ |\n| 17.6 | Count of 2s | ❌ |\n| 17.7 | Baby Names | ❌ |\n| 17.8 | Circus Tower | ❌ |\n| 17.9 | Kth Multiple | ❌ |\n| 17.10 | Majority Element | ❌ |\n| 17.11 | Word Distance | ❌ |\n| 17.12 | BiNode | ❌ |\n| 17.13 | Re-Space | ❌ |\n| 17.14 | Smallest K | ❌ |\n| 17.15 | Longest Word | ❌ |\n| 17.16 | The Masseuse | ❌ |\n| 17.17 | Multi Search | ❌ |\n| 17.18 | Shortest Supersequence | ❌ |\n| 17.19 | Missing Two | ❌ |\n| 17.20 | Continuous Median | ❌ |\n| 17.21 | Volume of Histogram | ❌ |\n| 17.22 | Word Transformer | ❌ |\n| 17.23 | Max Black Square | ❌ |\n| 17.24 | Max Submatrix | ❌ |\n| 17.25 | Word Rectangle | ❌ |\n| 17.26 | Sparse Similarity | ❌ |\n\n**If you find this useful, a Github star would be much appreciated!!**  ⭐ ⭐ ⭐ \n\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue to discuss what you want to change.\n\n\n## Contributors\n\nHuge thanks to our contributors!\n\n* [Gan3i](https://www.linkedin.com/in/ganeshnageshappa/)\n* [Farhan Juneja](https://www.linkedin.com/in/farhan-juneja/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpankg%2Fctci-python-solutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farpankg%2Fctci-python-solutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farpankg%2Fctci-python-solutions/lists"}