GithubHelp home page GithubHelp logo

telephone's Introduction

Telephone

Given a list of phone numbers, determine if it is consistent. In a consistent phone list no number is a prefix of another. For example:

  • Bob: 91125426
  • Alice: 97 625 992
  • Emergency: 911

In this case, it is not possible to call Bob because the phone exchange would direct your call to the emergency line as soon as you dialled the first three digits of Bob's phone number. So this list would not be consistent.

The input to your system will be a map of name to phone number. Names therefore cannot repeat (i.e. you don't have to deal with disambiguation). The output should be a boolean value: true if the list of phone numbers is consistent, false otherwise.

Extensions

Report back which entries are in conflict: "Bob @ 91125426" is unreachable because of "Emergency @ 911"

Add the ability to parse the phone number list from a text file in

<name> : <number> form

Credit

Cribbed from Emily Bache's "Coding Dojo Handbook"

telephone's People

Contributors

ctucker avatar

Watchers

 avatar Jeremy Norris avatar James Cloos avatar  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.