# 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/

• 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. Jul 24, 2015 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? Jul 24, 2015 at 2:31
• Voting to close as a duplicate of the linked challenge because, while not an exact duplicate, it isn't appreciably different. Jul 24, 2015 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 ;) Jul 24, 2015 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? Jul 24, 2015 at 5:29
• There is no "after tokenization" in TI-83 BASIC; the only way to enrer characters is as tokens. Jul 24, 2015 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.