• + 0 comments

    The problem definition is incorrect.

    It states that: idx = (x ⊕ lastAnswer)

    But it should read: idx = (x ⊕ lastAnswer) % n

    where n is one of the input variables.