01-edu / public

📚 @01-edu's Public Repository
http://public.01-edu.org/
199 stars 425 forks source link

elementary subject #2515

Closed tichagodwill closed 2 months ago

tichagodwill commented 3 months ago

elementary

const multiply = (a, b) => { if (a === 0 || b === 0) return 0; // take absolute values to handle negative numbers const absA = Math.abs(a); const absB = Math.abs(b); return ("i".repeat(absA).repeat(absB).length); }

This code is correct and runs perfectly on the terminal but when I submit it and run the test, I get this error test #6 failed: () => multiply(123, -22) === -2706

Error: Test failed at runTests (file:///app/test.mjs:184:15)

nprimo commented 3 months ago

Hi @tichagodwill, the solution provided in your comment is not returning the expected result.

Have you managed to pass this exercise already? Are you still thinking there is a problem with the exercise test?

nprimo commented 2 months ago

@tichagodwill feel free to open a new issue with more details if the issue persist :)