Ad
  • Custom User Avatar

    Make sure you're closing you curly braces and parentheses right. AFAIK the js tests are working fine.

  • Custom User Avatar

    Something seems to be not working right with the interpreter. My code is 10 lines long (a for loop with an if inside) but when I run the sample test it generates this stack trace:
    /home/codewarrior/index.js:22
    })})f;
    ^

    SyntaxError: Unexpected identifier
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at [eval]:1:1

    I have no idea where it's getting "})})f" from. What the heck is going on?

  • Custom User Avatar

    Also, give an example of the error messages you receive, I don't see any serious problems with your code.

  • Custom User Avatar

    Enclose your code in triple backticks as shown here (second example). It seems some of the symbols in your comment don't show up without proper formatting.

  • Custom User Avatar

    No, unless your solution works, no other user can see it. For cases like that, paste your code using proper markdown and mark your post as having spoiler content.

  • Custom User Avatar

    Oh, I see. Thank you!

  • Custom User Avatar

    That's not the input value, you're returning the result of dividing 3 by 56 (the error message is: your function output should be expected value) instead of returning the fraction.

  • Custom User Avatar

    Okay. But, I am recieving this error:

    '0.05357142857142857' should equal '3/56'

    why is the numerator 3 when all characters are not in "abcdefghijklm" and the length of the string is 19?

  • Custom User Avatar

    You have to calculate how many characters of the string are not in "abcdefghijklm".

  • Custom User Avatar

    I am not sure I understand the question correctly. The code to be written is only supposed to check when there is a bad control string and return the ratio, correct?