Closed tichagodwill closed 2 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?
@tichagodwill feel free to open a new issue with more details if the issue persist :)
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)