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
- Data Structures
- Arrays
- Dynamic Array
- Discussions
Dynamic Array
Dynamic Array
Sort by
recency
|
2037 Discussions
|
Please Login in order to post a comment
I do not understand the question itself. What is x and what is y ? what are queires. where is 5 oming from in the first example they gave
The introduction is wrong; it does not mention that the index needs to be modulo by the n parameter, as described in the explanation. :@@@@@
My Java solution with o(n) time complexity and o(n) space complexity:
The problem prompt idx = (x XOR lastAnswer) doesn't say that it should be modulo'ed by the size of the array.
Here is my c++ solution, you can watch the explanation here : https://youtu.be/MYdQxgmJ4Sk