/cracking-the-coding-interview

Solutions for Cracking the Coding Interview questions

Primary LanguagePythonMIT LicenseMIT

Cracking the Coding Interview - 6th Edition Solutions

Chapter 1 - String


  • Is Unique - To check if string has unique characters. JS | Python

  • Check Permutation - Decide if one string is permutation of the other. JS | Python

  • URLify - Replace all spaces in the string with %20. JS | Python

  • Palindrome Permutation - Check if given string is permutation of a palindrome. JS | Python

  • One Away - Check if the string are just one edit away. JS | Python

  • String Compression - Basic string compression with the counts of the characters. JS | Python

  • Rotate Matrix - Rotate a NxN matrix by 90°. Python

  • String Rotation - Using isSubstring method check if a string is substring of another. JS | Python

  • Zero Matrix - In MxN Matrix, make entire row and column 0 if a 0 is present. JS | Python

Chapter 2 - Linked List


  • Remove Dups - Remove duplicate from unsorted linked list. Python
  • Return Kth to last - Find the Kth to last element. Python
  • Delete Middle Node - Python
  • Partition - Partition a linked list around value X such that value less than X are below in the list. Python
  • Sum List - Backward & Forward Addition with linked list. Python
  • Palindrome - Python
  • Intersection - Python
  • Loop Detection - Python

Chapter 3 - Stacks and Queues


  • Three in One - Use single array to implement 3 stacks. Python
  • Stack Min - Design a stack which has min function and return minimum element and operates in O(n). Python
  • Stack of Plates - Python
  • Queue via Stacks - Python
  • Sort Stack - sort a stack such that smallest items are on top. Python
  • Animal Shelter - Python