diff --git a/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json b/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json
index 12f9aed960..d33e288694 100644
--- a/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json
+++ b/challenges/02-javascript-algorithms-and-data-structures/intermediate-algorithm-scripting.json
@@ -687,14 +687,14 @@
"fearNotLetter(\"abce\");"
],
"solutions": [
- "function fearNotLetter(str) {\n var s = str.split('').map(function(c) {return c.charCodeAt(0);});\n for (var i = 1; i < s.length; i++) {\n if (s[i]-1 != s[i-1]) {\n return String.fromCharCode(s[i]-1);\n }\n }\n}"
+ "function fearNotLetter (str) {\n for (var i = str.charCodeAt(0); i <= str.charCodeAt(str.length - 1); i++) {\n var letter = String.fromCharCode(i);\n if (str.indexOf(letter) === -1) {\n return letter;\n }\n }\n \n return undefined;\n}"
],
"tests": [
- "assert.deepEqual(fearNotLetter(\"abce\"), \"d\", 'message: fearNotLetter(\"abce\")
should return \"d\".');",
- "assert.deepEqual(fearNotLetter(\"abcdefghjklmno\"), \"i\", 'message: fearNotLetter(\"abcdefghjklmno\")
should return \"i\".');",
- "assert.deepEqual(fearNotLetter(\"stvwx\"), \"u\", 'message: fearNotLetter(\"stvwx\")
should return \"u\".');",
- "assert.isUndefined(fearNotLetter(\"bcd\"), 'message: fearNotLetter(\"bcd\")
should return undefined.');",
- "assert.isUndefined(fearNotLetter(\"yz\"), 'message: fearNotLetter(\"yz\")
should return undefined.');"
+ "assert.deepEqual(fearNotLetter('abce'), 'd', 'message: fearNotLetter(\"abce\")
should return \"d\".');",
+ "assert.deepEqual(fearNotLetter('abcdefghjklmno'), 'i', 'message: fearNotLetter(\"abcdefghjklmno\")
should return \"i\".');",
+ "assert.deepEqual(fearNotLetter('stvwx'), 'u', 'message: fearNotLetter(\"stvwx\")
should return \"u\".');",
+ "assert.deepEqual(fearNotLetter('bcdf'), 'e', 'message: fearNotLetter(\"bcdf\")
should return \"e\".');",
+ "assert.isUndefined(fearNotLetter('abcdefghijklmnopqrstuvwxyz'), 'message: fearNotLetter(\"abcdefghjklmnopqrstuvwxyz\")
should return undefined.');"
],
"type": "bonfire",
"MDNlinks": [
@@ -1409,4 +1409,4 @@
}
}
]
-}
\ No newline at end of file
+}