# Deep thought: Levenshtein distance [duplicate]

So, blatantly plagiarizing from inspired by this challenge and its sequel, I thought I'd add another.

The text to match:

What do you get when you multiply six by nine

The result your function/program/etc. should print or return:

42

An online calculator for Levenshtein distance can be found here: http://planetcalc.com/1721/

## marked as duplicate by Alex A., Downgoat, Beta Decay, Peter Taylor, feersumJul 24 '15 at 9:11

• Personally, I don't find these challenges very interesting. Most of the time it's near-impossible to have any meaningful overlap with the text, leading to submissions which just leave the excess floating around. – Sp3000 Jul 24 '15 at 2:12
• Fair enough. I haven't seen all that many of these myself, though - do they have a tag associated with them, or are they just that bad? – Stephen Voris Jul 24 '15 at 2:31
• Voting to close as a duplicate of the linked challenge because, while not an exact duplicate, it isn't appreciably different. – Alex A. Jul 24 '15 at 3:29
• This is much too similar, and in much too close succession. If you're going to steal a challenge, at least wait until it's long dead before posting it ;) – Beta Decay Jul 24 '15 at 5:31

# GolfScript, 2

What 42 you get when you multiply six by nine


All words except do are undefined tokens, so they do nothing.

Try it online in Web GolfScript.

# TI-BASIC, 3

Replaces the first character with length(, which is a single TI-BASIC token.

length("t do you get when you multiply six by nine

• So you're allowed to count the length of your program after tokenisation? – Beta Decay Jul 24 '15 at 5:29
• There is no "after tokenization" in TI-83 BASIC; the only way to enrer characters is as tokens. – lirtosiast Jul 24 '15 at 14:25

# Ruby, 10

p"What do you get when you multiply six by nine".sum/99


In the spirit of the challenge. Following the letter I think the best you can do is

p 42||"What do you get when you multiply six by nine"


but that program would still work if you changed the string.

# Pyth, 4

42 "What do you get when you multiply six by nine


That's not a comment, it's a string that doesn't get printed.

# CJam, 3

"hat do you get when you multiply six by ni",


, pushes the string's length.

Try it online in the CJam interpreter.

## CMD, 9

echo 42||What do you get when you multiply six by nine


Code after || inline will only run if the previous command generates an error.