We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Fundamentals
- Even Odd Query
- Discussions
Even Odd Query
Even Odd Query
Sort by
recency
|
147 Discussions
|
Please Login in order to post a comment
Even though the code is incorrect, it passes the test cases. The reason is: when A[x] is even, and both A[x+1] = 0 and A[x+2] = 0, the result should be Even. However, the code does not handle this correctly, yet it still passes the tests.
The problem is better if some example is given with recursion
Thanks for sharing valuable post Sabexch
This code defines a recursive function find(x, y) to determine whether the value of pow(A[x], find(x+1, y)) is odd or even. World 777
This is bullshit. Problem statement is vague and does not walk through any example. I wish I could give this negative star.