39
5
This is a simple challenge: Given a sequence of integers, find the sum of all integers in it.
But with a twist. Your score is the Levenshtein distance between your code and the following phrase (The challenge):
Given a set of integers, find the sum of all integers in it.
You may assume there are no newlines or trailing spaces in the input.
Example input/output:
Input: 1 5 -6 2 4 5
Output: 11
Input: 1 -2 10
Output: 9
An online calculator for Levenshtein distance can be found here: http://planetcalc.com/1721/
4
I can't help but think of this
– JohnE – 2015-07-23T00:58:52.750I edited it so that it can be a function. Don't know why I put that it :P – None – 2015-07-23T01:03:05.170
So functions are allowed? – kirbyfan64sos – 2015-07-23T01:29:53.160
Functions are allowed, yes. – None – 2015-07-23T01:30:10.013
7Wow, so much creativity guys xD... cough comment abusers cough – None – 2015-07-23T01:30:43.047
1Do you think this should have a sequel with another challenge but same Levenshtein distance principal? Not sure if this is considered sequel-worthy or not. – None – 2015-07-23T01:35:28.377
1@NicoA definitely! Maybe the only problem is that this task was too easy. – Maltysen – 2015-07-23T01:40:25.060
1I might even make comments not allowed because you can just place a comment in with the challenge and then after that it just becomes a code golf competition. – None – 2015-07-23T01:41:50.233
2@NicoA If you do, be very careful in defining what's not allowed. Many languages allow raw strings to float around, for instance. – xnor – 2015-07-23T01:48:56.103
1Your examples make clear that you don't mean "set of integers" but rather "sequence of integers": you sum both occurences of "5" in your second example. Now there are already dozens of rated solutions so it's not really feasible to change the metric. But maybe at least change the actual text of the task? – None – 2015-07-23T07:40:53.593