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.
I also faced same issue .
And later i realised it better to use array here :
1) since number of elements is very large (10^5)
2) arrays can store data very compactly
3) arrays data structure offer more efficient storage
AND code runs fine without os module
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array and simple queries
You are viewing a single comment's thread. Return to all comments →
I also faced same issue . And later i realised it better to use array here : 1) since number of elements is very large (10^5) 2) arrays can store data very compactly 3) arrays data structure offer more efficient storage AND code runs fine without os module