GithubHelp home page GithubHelp logo

add-a-gram's Introduction

add-a-gram

An "add-a-gram" is a sequence of words formed by starting with a 3-letter word, adding a letter and rearranging to form a 4-letter word, and so on. For example, here are add-a-grams of the words "CREDENTIALS" and "ANACHRONISM":

ail + s =
sail + n =
nails + e =
aliens + t =
salient + r =
entrails + c =
clarinets + e =
interlaces + d =
CREDENTIALS (length 11)

mar + c =
cram + h =
march + s =
charms + o =
chromas + n =
monarchs + i =
harmonics + a = 
maraschino + n = 
ANACHRONISM (length 11)

Test your own credentials: given the dictionary found here, what is the longest add-a-gram?

Solution

This was an ITA puzzle that was used between December 01 and April 02.

 (time (get-longest-add-a-gram))
 "Elapsed time: 363.542542 msecs"
 =>
 ([\i "not"]
 [\n "into"]
 [\s "niton"]
 [\e "nitons"]
 [\m "intones"]
 [\a "mentions"]
 [\i "nominates"]
 [\r "antinomies"]
 [\t "nitrosamine"]
 [\d "terminations"]
 [\e "antimodernist"]
 [\i "determinations"]
 [\n "intermediations"]
 [nil "indeterminations"])
 (count "indeterminations")
 => 16

The solution is not unique. Another solution is "underestimations", which is also 16 letters long.

This seems to be one of ITA's easier puzzles. My solution clocks in at around 50 lines of Clojure and runs in 360ms on my machine. Machines were slower and technology less advanced 20 years ago, but I am sure I could have solved it in Common Lisp or Java with a run time under 10 secs.

add-a-gram's People

Contributors

rachbowyer avatar

Watchers

 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.