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
|
2055 Discussions
|
Please Login in order to post a comment
Admin or @ikbalkazar, please correct the problem description.
In query 1 and query 2:
from:
idx = (x ^ lastAnswer)
to:
idx = (x ^ lastAnswer) % n
i think they forgot to mention for index computation it should be moudulos of n
idx = (x ^ lastAnswer) % n
idx = (x ^ lastAnswer) % n
gguys with this you can try yoursself
I figured out that the question phrasing is poor and not consistent, since care needs to be taken to modulo index, otherwise lastAnswer becomes bigger than array bounds, Python 3 code:
The instructions say one thing about how to calculate the idx and the example shows another thing which is confussing
This question literally suck my time ,and this is none to improve your DSA skill other making you chaotic ,so better move on to the next problem.
DSA is some thing to kindle your thought beyond the given question,but here the provided essesntials are unclear.