You must log in or # to comment.

bool isOdd(int num) { const oddNumbers = []; for (let i = 1; i <= 10000000; i += 2) { oddNumbers.push(i); } if (oddNumbers.includes(num) { return true; } }isOdd(-1);deleted by creator
Maybe memo just to be safe, but LGTM!
isOdd(10000001);
this incident has been reported
To fix this, add
if(num == 255) return true;before line 10.Will this ever return? Won’t it just overflow the stack?
https://www.npmjs.com/package/is-even
don’t look at the weekly downloads if you are faint of heart.
If you really want to see some horror, follow the dependencies
Boss: don’t spend any time on it, just vibe code a solution.
You: sure, I enjoy receiving a salary, what could go wrong?
isEven(0) -> true; isEven(Num) -> isOdd(Num-1). isOdd(0) -> false; isOdd(Num) -> isEven(Num-1).Removed by mod
Removed by mod
Removed by mod






