ctci-chambers

A Typescript implementation of the solutions to Cracking the Coding Interview by Gayle McDowell

Usage no npm install needed!

<script type="module">
  import ctciChambers from 'https://cdn.skypack.dev/ctci-chambers';
</script>

README

npm version

ctci-chambers

A Typescript implementation of the solutions to Cracking the Coding Interview by Gayle McDowell.

Setup

Install

npm install ctci-chambers

Usage

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

API Overview

  • Chapter 1: Arrays and Strings:
    • isUnique
    • isPermutation
    • urlify
    • isPalindromePermutation

Test

Tests are written using Jest. Install the project dependencies first, then run the tests.

npm install
npm test

Why?

I had two goals in mind:

  1. Deploy a package to npm.
  2. Solve all the questions in Cracking the Coding Interview.

It was a way to also practice semantic versioning, documentation, commit messages, TDD, and more.