A Typescript implementation of the solutions to Cracking the Coding Interview by Gayle McDowell.
npm install ctci-chambers
Import the entire package:
import * as ctci from 'ctci-chambers';
ctci.isPalindromePermutation('race car'); // true
ctci.isPalindromePermutation('nope'); // false
or, import only the desired functions:
import { isPalindromePermutation } from 'ctci-chambers';
isPalindromePermutation('race car'); // true
isPalindromePermutation('nope'); // false
- Chapter 1: Arrays and Strings:
isUnique
isPermutation
urlify
isPalindromePermutation
Tests are written using Jest. Install the project dependencies first, then run the tests.
npm install
npm test
I had two goals in mind:
- Deploy a package to npm.
- Solve all the questions in Cracking the Coding Interview.
It was a way to also practice semantic versioning, documentation, commit messages, TDD, and more.