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.
The problem statement is misleading and syntactically unclear.
The definition of idx is incomplete — it says idx = (x ⊕ lastAnswer) but completely omits the necessary modulo operation % n.
Additionally, the query syntax is confusing (e.g., 1 x y, 2 x y) and could be better explained as “a query consists of three integers: type, x, y”.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Dynamic Array
You are viewing a single comment's thread. Return to all comments →
The problem statement is misleading and syntactically unclear. The definition of idx is incomplete — it says idx = (x ⊕ lastAnswer) but completely omits the necessary modulo operation % n.
Additionally, the query syntax is confusing (e.g., 1 x y, 2 x y) and could be better explained as “a query consists of three integers: type, x, y”.