Sort by

recency

|

147 Discussions

|

  • + 0 comments

    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.

    If A[x] is odd, then the recursive result is Odd.
    If A[x] is even, check whether A[x+1] is 0 recursively:
        If A[x] is even and A[x+1] is 0, then the result is Odd.
        If A[x] is even and A[x+1] is not 0, then the result is Even.
    
  • + 0 comments

    The problem is better if some example is given with recursion

  • + 0 comments

    Thanks for sharing valuable post Sabexch

  • + 0 comments

    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

  • + 0 comments

    This is bullshit. Problem statement is vague and does not walk through any example. I wish I could give this negative star.