These are chat archives for Codewars/codewars.com/kata-solving-help

22nd
Sep 2016
Sanket Ray
@iamsanketray123
Sep 22 2016 18:58
solving my fisrt 3kyu question....9tests pass but 1 fails...I cant really see my mistake...can someone please help?
https://www.codewars.com/kata/help-the-general-decode-secret-enemy-messages/train/javascript
device.decode = function (w) {
console.log(w)
const alphabet="bdhpF,82QsLirJejtNmzZKgnB3SwTyXG ?.6YIcflxVC5WE94UA1OoD70MkvRuPqHabdhpF,82QsLirJejtNmzZKgnB3SwTyXG ?.6YIcflxVC5WE94UA1OoD70MkvRuPqHa"
 w=w.split("")
 for(var i=0;i<w.length;i++)
 {var b=alphabet.lastIndexOf(w[i])
 w[i]=alphabet[b-i-1];
 }
 return w.join("")

}