GithubHelp home page GithubHelp logo

anagram-sorter's Introduction

Anagram Assignment

Table of Contents

The Task

Write a program that takes as argument the path to a file containing one word per line, groups the words that are anagrams to each other, and writes to the standard output each of these groups.

The groups should be separated by newlines and the words inside each group by commas.

The Data

You can make the following assumptions about the data in the files:

  • The words in the input file are ordered by size
  • Production files will not fit into memory all at once (but all the words of the same size would)
  • The words are not necessarily actual English words, for example, “abc” and “cba” are both considered words for the sake of this exercise.

The files provided in the Data folder are just sample input data to help you reason about the problem. Production files will be much bigger.

Expected Output

abc,bac,cba
unf,fun
hello

Getting Started

Requirements:

  • node v14.17.x

Development

yarn
yarn dev

Testing

yarn
yarn test

// Coverage report
yarn test --coverage

anagram-sorter's People

Contributors

hloughrey avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.