{"id":16536318,"url":"https://github.com/avidlearnerinprogress/ctci-solutions","last_synced_at":"2025-04-10T23:04:12.014Z","repository":{"id":110154486,"uuid":"188959662","full_name":"avidLearnerInProgress/CTCI-solutions","owner":"avidLearnerInProgress","description":"C++ and Python Solutions from the book \"Cracking the coding interviews\"","archived":false,"fork":false,"pushed_at":"2019-11-14T06:30:43.000Z","size":682,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T23:04:05.404Z","etag":null,"topics":["cpp11","cracking-the-coding-interview","ctci-6th","ctci-solutions","python3"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/avidLearnerInProgress.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-28T05:26:23.000Z","updated_at":"2021-04-08T04:07:31.000Z","dependencies_parsed_at":"2023-03-13T13:57:48.829Z","dependency_job_id":null,"html_url":"https://github.com/avidLearnerInProgress/CTCI-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/avidLearnerInProgress%2FCTCI-solutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidLearnerInProgress%2FCTCI-solutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidLearnerInProgress%2FCTCI-solutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidLearnerInProgress%2FCTCI-solutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avidLearnerInProgress","download_url":"https://codeload.github.com/avidLearnerInProgress/CTCI-solutions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312141,"owners_count":21082638,"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":["cpp11","cracking-the-coding-interview","ctci-6th","ctci-solutions","python3"],"created_at":"2024-10-11T18:30:34.144Z","updated_at":"2025-04-10T23:04:11.992Z","avatar_url":"https://github.com/avidLearnerInProgress.png","language":"C++","readme":"# Cracking the Coding Interview (CtCI) Solutions\"\n\nThis repository contains C++ and Python solutions to the problems in the sixth edition of [Cracking the Coding Interview](http://www.crackingthecodinginterview.com/) by [Gayle Lackmann McDowell](http://www.gayle.com/).\n\n### Chapter 1: \n\n* Is Unique - _Determine if a string has all unique characters_ **_\u0026rarr;_**  **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#is-unique)** \n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/Is%20Unique/is_unique.cpp)_**  **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/Is%20Unique/is_unique.cpp)_**\n* Check Permutation - _Check if one string is a permutation of another_ **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#check-permutation)**  \n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/Check%20Permutation/check_permutation.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/Check%20Permutation/check_permutation.py)_** \n* URLify - _Replace all spaces in string with '%20'_ **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#urlify)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/URLify/urlify.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/URLify/urlify.py)_**\n* Palindrome Permutation - *_Check if string is permutation of its palindrome_* **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#palindrome-permutation)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/Palindrome%20Permutation/palindrome_permutation.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/Palindrome%20Permutation/palindrome_permutation.py)_**\n* One Away - *_Check if two strings are one or zero edits away_* **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#one-away)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/One%20Away/one_away.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/One%20Away/one_away.py)_**\n* String Compression - *_Perform string compression using counts of repeated characters_* **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#string-compression)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/String%20Compression/string_compression.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/String%20Compression/string_compression.py)_**\n* Rotate Matrix - *_Rotate given nxn image by 90 degrees inplace_* **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#rotate-matrix)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/Rotate%20Matrix/rotate_matrix.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/Rotate%20Matrix/rotate_matrix.py)_**\n* Zero Matrix - *_Replace other elements in rows and columns if element is 0_* **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#zero-matrix)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/Zero%20Matrix/zero_matrix.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/Zero%20Matrix/zero_matrix.py)_**\n* String Rotation - *_Check if string s2 is rotation of string s1 using isSubstring()_* **_\u0026rarr;_** **[Overview](/Chapter%201%20-%20Arrays%20and%20Strings#string-rotation)**\n  * **_[C++](/Chapter%201%20-%20Arrays%20and%20Strings/String%20Rotation/string_rotation.cpp)_** **|** **_[Python](/Chapter%201%20-%20Arrays%20and%20Strings/Zero%20Matrix/string_rotation.py)_**\n\n### Chapter 2:\n* Remove Dups - *_Remove duplicates from unsorted linked list_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Remove%20Dups/remove_dups.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Remove%20Dups/remove_dups.py)_**\n* Return Kth To Last - *_Find kth to last element of singly linked list_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Return%20Kth%20To%20Last/return_kth_to_last.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Return%20Kth%20To%20Last/return_kth_to_last.py)_**\n* Delete middle node - *_Delete a node in middle of singly linked list_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Delete%20Middle%20node/delete_middle_node.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Delete%20Middle%20node%20/delete_middle_node.py)_**\n* Partition - *_Partition singly linked list around x_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Partition/partition.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Partition/partition.py)_**\n* Intersection - *_Given 2 SLL, check if they intersect_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Intersection/Intersection.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Intersection/Intersection.py)_**\n* Loop Detection - *_Detect loop in Circular Linked List_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Loop%20Detection/loop_detection.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Loop%20Detection/loop_detection.py)_**\n* Sum Lists - *_Add 2 numbers represented by Linked Lists_* **_\u0026rarr;_** **_[C++](/Chapter%202%20-%20Linked%20Lists/Sum%20Lists/sum_lists_forward1.cpp)_** **|** **_[Python](/Chapter%202%20-%20Linked%20Lists/Sum%20Lists/sum_lists_backward.py)_**\n  \n### Chapter 3:  \n* Three In One - *_Implement k(3) stacks using single array_* **_\u0026rarr;_** **_[C++](/Chapter%203%20-%20Stacks%20and%20Queues/Three%20in%20One/three_in_one.cpp)_** **|** **_[Python](/Chapter%203%20-%20Stacks%20and%20Queues/Three%20in%20One/three_in_one.py)_**\n* Stack Min - *_Design min stack that performs push, pop and min in O(1)_* **_\u0026rarr;_** **_[C++](/Chapter%203%20-%20Stacks%20and%20Queues/Stacks%20Min/stack_min.cpp)_** **|** **_[Python](/Chapter%203%20-%20Stacks%20and%20Queues/Stack%20Min/stack_min.py)_**\n* Stack Of Plates - *_Implement set of stacks with popAt operation_* **_\u0026rarr;_** **_[C++](/Chapter%203%20-%20Stacks%20and%20Queues/Stack%20Of%20Plates/stack_of_plates.cpp)_** **|** **_[Python](/Chapter%203%20-%20Stacks%20and%20Queues/Stack%20Of%20Plates/stack_of_plates.py)_**\n* Queue Via Stacks - *_Implement queue data structure with 2 stacks_* **_\u0026rarr;_** **_[C++](/Chapter%203%20-%20Stacks%20and%20Queues/Queue%20Via%20Stacks/queue_via_stacks.cpp)_** **|** **_[Python](/Chapter%203%20-%20Stacks%20and%20Queues/Queue%20Via%20Stacks/queue_via_stacks.py)_**\n* Sort Stacks - *_Sort stack in ascending order using a temporary stack_* **_\u0026rarr;_** **_[C++](/Chapter%203%20-%20Stacks%20and%20Queues/Sort%20Stack/sort_stack.cpp)_** **|** **_[Python](/Chapter%203%20-%20Stacks%20and%20Queues/Sort%20Stack/sort_stack.py)_**\n* Animal Shelter - *_Design system to allocate animals on FIFO basis from animal shelter_* **_\u0026rarr;_** **_[C++](/Chapter%203%20-%20Stacks%20and%20Queues/Animal%20Shelter/animal_shelter.cpp)_** **|** **_[Python](/Chapter%203%20-%20Stacks%20and%20Queues/Animal%20Shelter/animal_shelter.py)_**\n\n### Chapter 4:  \n\n* Route Between Nodes - *_Check if path exists between two nodes of directed graph_* **_\u0026rarr;_** **_[C++](/Chapter%204%20-%20Trees%20and%20Graphs/Route%20Between%20Nodes/route_between_nodes.cpp)_** **|** **_[Python](/Chapter%204%20-%20Trees%20and%20Graphs/Route%20Between%20Nodes/route_between_nodes.py)_**\n* List Of Depths - *_Create LinkedList of Nodes at each depth of binary tree_* **_\u0026rarr;_** **_[C++](/Chapter%204%20-%20Trees%20and%20Graphs/List%20Of%20Depths/list_of_depths.cpp)_** **|** **_[Python](/Chapter%204%20-%20Trees%20and%20Graphs/List%20Of%20Depths/list_of_depths.py)_**\n* Check Balanced - *_Check if Binary Tree is balanced_* **_\u0026rarr;_** **_[C++](/Chapter%204%20-%20Trees%20and%20Graphs/Check%20Balanced/check_balanced.cpp)_** **|** **_[Python](/Chapter%204%20-%20Trees%20and%20Graphs/Check%20Balanced/check_balanced.py)_**\n* Minimal Tree - *_Construct Binary Search Tree from Sorted Array_* **_\u0026rarr;_** **_[C++](/Chapter%204%20-%20Trees%20and%20Graphs/Minimal%20Tree/minimal_tree.cpp)_** **|** **_[Python](/Chapter%204%20-%20Trees%20and%20Graphs/Minimal%20Tree/minimal_tree.py)_**\n* Validate BST - *_Check if Binary Tree is Binary Search Tree_* **_\u0026rarr;_** **_[C++](/Chapter%204%20-%20Trees%20and%20Graphs/Validate%20BST/validate_bst.cpp)_** **|** **_[Python](/Chapter%204%20-%20Trees%20and%20Graphs/Validate%20BST/validate_bst.py)_**\n* First Common Ancestor - *_Find first common ancestor for 2 nodes in Binary Tree_* **_\u0026rarr;_** **_[C++](/Chapter%204%20-%20Trees%20and%20Graphs/First%20Common%20Ancestor/first_common_ancestor.cpp)_** **|** **_[Python](/Chapter%204%20-%20Trees%20and%20Graphs/First%20Common%20Ancestor/first_common_ancestor.py)_**\n\n\n### Miscellaneous:\n\n* [Problems](/Miscellaneous/Readme.md) - *_List of relevant problems implemented outside of CTCI_*\n\n## Todo's:\n- [ ] Readme per chapter explaining solutions  \n- [ ] Blog posts per chapter  \n- [ ] Code refactoring  \n- [ ] Alternatives to organise readme in better manner","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favidlearnerinprogress%2Fctci-solutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favidlearnerinprogress%2Fctci-solutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favidlearnerinprogress%2Fctci-solutions/lists"}