Hello, I can't get my solution accepted and I don't understand what is wrong.
My code:
function endZeros(a: number): number {
let b = String(a);
let out:number = 0;
for (let i = b.length - 1; i >= 0; i--)
{
if (b[i] != 0) { return out }
out += 1;
}
return out;
}
When checking solution I get error:
9,13: This condition will always return 'true' since the types 'string' and 'number' have no overlap.
Created at: 2022/10/06 19:48; Updated at: 2022/10/10 17:27
The question is resolved.