Skip to content

Instantly share code, notes, and snippets.

Problem

You have two files - names.txt and characters.txt.

The characters.txt file contains all the characters needed to spell two names from the names.txt file.

When the correct names are found:

  • Every character from characters.txt will be used exactly once
  • There will be no unused characters
@webdesserts
webdesserts / line-splitter.js
Last active December 15, 2015 18:19 — forked from deoxxa/line-splitter.js
Creates a transform stream that splits any stream pipped into it into lines.
var stream = require("stream"),
util = require("util");
var LineSplitter = function LineSplitter(options) {
options = options || {};
options.objectMode = true;
stream.Transform.call(this, options);
this.buffer = "";
};
util.inherits(LineSplitter, stream.Transform);